i have made a (not soooo good ) game using vs2008
i have a controller class which holds a level loader class
once i quit the game i do
delete Controller // from the main file
which goes to the controller destructor :
Controller::~Controller(){
delete screen;
delete loader;
delete eventer;
}
which than go to the level loader
LevelLoader::~LevelLoader()
{
eraseLevel();// function that deallocs all malloced info
}
everything is fine during the deletion and the ~levelLoader is finished
getting back to the ~controller
Controller::~Controller(){
delete screen;
delete loader;
delete eventer;
} // AT THIS POINT EVERYTHING CRASHES
when the d-tor of the controller is finnished i get this error (img attached)
tryed changing the deletes to delete [] (not sure i understand the difference)
but that didnt work
i have a boolean that checks if i free the stuff more than once and i dont.
btw level loader and controlelr destructors are virtual if that makes any difference
been googling the problem but without success.
thank you appreciate your help!