After a bit of googling i think so i know where the problem lies,
Seriously, did you really need google to tell you that your program has a memory corruption bug or you're mishandling pointers? Also, google knows nothing about your program or anyone else's program, so looking at google for an answer isn't an option. The only one that can fix your program is you and anyone else who happens to have all of your code.
Below is the relevant piece of code.
"Relevant code" in your case requires the entire code as well as the data used to drive the code so that everyone here can run the code and tell you what to fix.
No one knows what's behind those variables you posted, the state of the program when the corruption occurs, the flow and the logic of the program, etc. All of these are required for others to diagnose memory run-time issues. Just posting a few lines of code that are syntactically correct will not help.
For example, I've just broken your objects with this 2 line program: