for (count = 0; count < MAX_PLANET_TYPES; count++){
if (PlanetStructures[count] != NULL){
MessageBox(NULL,"test",APP_NAME,MB_OK);
delete PlanetStructures[count];
}
if (PlanetImages[count] != NULL){
DeletePNG(PlanetImages[count]);
delete PlanetImages[count];
}
}
Works perfectly, while:
for (count = 0; count < MAX_PLANET_TYPES; count++){
if (PlanetStructures[count] != NULL){
delete PlanetStructures[count];
}
if (PlanetImages[count] != NULL){
DeletePNG(PlanetImages[count]);
delete PlanetImages[count];
}
}
Causes the program to crash, and give me an option to send an error report. And the worst thing is that the messagebox doesn't even show up, because I'm not loading any structures yet! The inclusion of the messagebox which isn't even accessed suddenly causes the program to run like it's perfect. Why!?! I even tried just adding a semi-colon in place of the messagebox, and it doesn't work!