Game Development Community

iTGB - game crashes when level is loaded a 2nd time

by Conor O'Kane · in iTorque 2D · 02/19/2009 (2:35 am) · 3 replies

My game is crashing with an EXC_BAD_ACCESS when I load a level, return to the menu and then reload the same level a 2nd time. The debugger shows that it's stopping on t2dImageMapDatablock::unloadSrcBitmap - but it doesn't show which image.

If I change around the images in the background tilemap - SOMETIMES the crash goes away, but not always. Also, with 2 identical levels, sometimes one of them works and the other fails.

This is incredibly frustrating and hard to decipher, as the behavior isn't consistent.

Anyone got any suggestions?

#1
02/19/2009 (3:38 am)
Well I've found a workaround, although it's not exactly a fix. If I switch the image used in the background for the affected levels to allowUnload="0" it no longer crashes.

All of my other images are set to allowUnload="1", and it isn't a problem for them!
#2
02/19/2009 (9:54 am)
I've never had this problem.
when you return to mainMenu do you delete the level? levelEnd();
#3
05/25/2009 (10:39 pm)
Wow

I can't even load my game a 2nd time either after I load it once from the editor... This is ridiculous.