From: Oli N. <no...@bt...> - 2001-08-31 22:55:49
|
Hi, I have created a game in Allegro and have been told that it has some memory leaks. I understand that for this to happen you would be using the 'new' and 'delete' operators and then forgetting to 'delete' something that you have created with 'new'. I have searched through my project and have not used 'new' or 'delete' anywhere. I was then thinking the memory leak must be something to do with Allegro?. The friend who reported the problem is using Windows 2000 and said the memory was leaking at a constant rate whilst my program was sitting idle. I am using Windows 98 with MSVC6 and Allegro 3936. After running my game for a long time it slows my machine down to a crawl when exiting. I think this could be the same problem?. The only thing I can think of that might be odd is that I am loading a new 'background' PCX file (800x600x8) at regular intervals and its when you race through the game and load the PCX files at great speed the problems occur (I think). Basically I have two 'buffers' like this. BITMAP* buffer; BITMAP* picbuffer; I then create them like this. buffer=create_bitmap(800x600); picbuffer=create_bitmap(800x600); And each time I want to get a new picture I do this. picbuffer=load_pcx("picturehere.pcx",pal); and then blit the picbuffer onto the buffer when its needed. I was wondering whether doing this could cause problems and possibly be the cause of the memory leak? Also does Allegro 3937 fix anything big with the MSCV port?. I am too scared to upgrade when I need to have finished my game in the next few days. Thanks in advance, Oli Norwell |