[SOLVED] Memory leaks due to improper deallocation

shenjoku

23-12-2013 00:16:44

There are a lot of tiny memory leaks being cause by the cSound and efxProperty structs being deallocated incorrectly in OgreOggSoundManager. For example, when processing the LQ_LOAD case in OgreOggSoundManager::_performAction() it's doing:
OGRE_FREE(c, Ogre::MEMCATEGORY_GENERAL);

I looked at the documentation and it clearly states that using OGRE_FREE() will not call the destructor, which is the source of the leak since these structs contain Ogre::String objects that need to be destructed or else they will leak. Everywhere that OGRE_FREE() is being used needs to be changed to OGRE_DELETE_T(). For this example it would look like:
OGRE_DELETE_T(c, cSound, Ogre::MEMCATEGORY_GENERAL);

I've uploaded a patch to mediafire since I can't seem to attach it for some reason. Is there a bug tracker somewhere I should be posting these issues? The source forge tracker is completely empty so I'm unsure of how to go about this.

stickymango

06-01-2014 17:23:06

Thanks for the patch, implemented.