Hi,
Im having some memory leak problems, im creating objects of classes which display on screen using SDL and play sound using FMOD. I then delete the object using delete and create a new object that does similiar, eg.
#include "SDL.h"
#include "menu.h"
#include "game.h"
// main, run menu screen, then run game.
int main( int argc, char* argv[] )
{
int loop=1;
while(loop){
menu *m = new menu();
if(m->run()==1){
delete m;
Game *g = new Game();
delete g;
}//if player chooses start 1 will be returned and the game will start else the game will exit
else loop=0;//end
}
return ( 0 ) ;
}
the objects dont seem to be getting deleted and the memory increases each time.
any advice how i can make sure that the objects are deleted completly, including everything the object holds.
2006-12-06
09:07:43
·
5 answers
·
asked by
karljj1
4
in
Computers & Internet
➔ Programming & Design