PLSM create leaks normal?

JPro

29-06-2006 20:14:29

My fairly simple program reports a great number of leaks to OgreLeaks.log, all of which are from "OgrePagingLandScapeSceneManager.cpp(384) Ogre::PagingLandScapeSceneManager::crea". I assume this is the PLSM creating tiles, but there are upwards of 3,000 reported leaks resulting from this function after only a few minutes of play. The more terrain I load (by moving around the map) the more leaks result. A small snippet of my OgreLeaks.log:

2617 memory leaks found:

Alloc. Addr Size Addr Size BreakOn BreakOn
Number Reported Reported Actual Actual Unused Method Dealloc Realloc Allocated by
------ ---------- ---------- ---------- ---------- ---------- -------- ------- ------- ---------------------------------------------------
057469 0x05AFAC58 0x00000014 0x05AFAC48 0x00000034 0x00000000 new N N ??(0) ??
057468 0x05B15738 0x00000014 0x05B15728 0x00000034 0x00000000 new N N ??(0) ??
068637 0x05B3E100 0x00000014 0x05B3E0F0 0x00000034 0x00000000 new N N ??(0) ??
068638 0x05B3E170 0x00000014 0x05B3E160 0x00000034 0x00000000 new N N ??(0) ??
068644 0x05B3E1E0 0x00000050 0x05B3E1D0 0x00000070 0x00000000 new N N OgrePagingLandScapeSceneManager.cpp(384) Ogre::PagingLandScapeSceneManager::crea
043386 0x0676FDE0 0x00000160 0x0676FDD0 0x00000180 0x00000000 new N N ogrewin32platformdll.cpp(91) Ogre::createPlatformInputReader
043387 0x0676FFA0 0x00000014 0x0676FF90 0x00000034 0x00000000 new N N ??(0) ??
057528 0x0685F190 0x00000014 0x0685F180 0x00000034 0x00000000 new N N ??(0) ??
056937 0x0686EF90 0x00000014 0x0686EF80 0x00000034 0x00000000 new N N ??(0) ??
056935 0x06872AB8 0x00000014 0x06872AA8 0x00000034 0x00000000 new N N ??(0) ??
057967 0x06A002C8 0x00000014 0x06A002B8 0x00000034 0x00000000 new N N ??(0) ??
059604 0x090B0FC8 0x00000014 0x090B0FB8 0x00000034 0x00000000 new N N ??(0) ??
056936 0x090B31E0 0x00000014 0x090B31D0 0x00000034 0x00000000 new N N ??(0) ??
089010 0x090D03B8 0x00000050 0x090D03A8 0x00000070 0x00000000 new N N OgrePagingLandScapeSceneManager.cpp(384) Ogre::PagingLandScapeSceneManager::crea
057995 0x09146A30 0x00000014 0x09146A20 0x00000034 0x00000000 new N N ??(0) ??
056934 0x09146AA8 0x00000050 0x09146A98 0x00000070 0x00000000 new N N


... etc etc


Is this normal behavior of PLSM? If not, what is the proper way to end the PLSM? My game is currently using gamestates, so prior to shutdown it goes into the "introstate" and switches to ST_GENERIC (which I previously assumed destroyed the world tiles/terrain). In the process of trying to fix this I've eliminated all other forms of memory leak (a nice bonus!), now I just want to know if I should continue hunting down PLSM's leak or let it go.

tuan kuranes

02-07-2006 10:22:56

I did found some leaks and fixed all them in a new downloadable SDK and in CVS.

But some seems to come from your code too.

Be sure to release any object created from scenemanager (queries ?), your Ogre::InputReader.

jacmoe

02-07-2006 18:17:44

If you're not doing a delete Root::getSingletonPtr(); you will get leaks.