DarthMike / indielib-crossplatform

IndieLib is a cross-platform Game Graphics engine. Main focus is OpenGL ES 2.0 for mobile iOS operating system, and OpenGL desktop. **NOT SUPPORTED ANYMORE**
zlib License
61 stars 27 forks source link

Memory Leaks : IND_Image #109

Closed AlainBridel closed 11 years ago

AlainBridel commented 11 years ago

In IND_FontManager (add, method) and IND_SurfaceManager (add methods) the new IND_Image() allocated are not free but just "remove" from the imagemanager those resulting in memory leaks.

DarthMike commented 11 years ago

@AlainBridel Fixed. Needs more work, as stated in issue #112, but memory leaks are fixed. Thanks again for your feedback and please review this change.

AlainBridel commented 11 years ago

I have seen a lot of work regarding memory, but I think this should also be updated :

In IND_FontManager Line 124 // Free the image _imageManager->remove(mNewImage);

return 1;

Should be changed to // Free the image _imageManager->remove(mNewImage);

---> DISPOSE(mNewImage);

return 1;

In IND_SurfaceManager Line 168, 240, 276, 351 same applies.

A temporary image is instanciated to work with it, removed from the image manager but not deleted.

DarthMike commented 11 years ago

Yes I missed that one. Thanks