Some memory-management related problems
Posted: Sun Jan 16, 2005 02:37
So, straight into it. I'm experiencing some strange behaviour and I wonder if anyone else saw these or just I managed to mess something again.
This is how I start the system:
...and this is how I end it:
Now, I have two problems/questions.
Using line like this
results in memory leaks, according to OgreLeaks.log (4 leaks, ogredatachunk.cpp(55) Ogre:: DataChunk::allocate).
This snippet
however gives an assert (_BLOCK_TYPE_IS_VALID(pHead->nBlockUse) ) on the delete CEGUI::System::getSingletonptr() line when I try to exit in debug.
Log:
And that's it. Normally the line "Font 'Tahoma-12' has been destroyed." should follow.
I have a feeling the second one is thanks to my messup, just with all these changes lately I wondered if anyone else experienced them. If this was already noted somewhere... sorryyy, I tried searching
EDIT: Oh and I use the latest stable releases in both OGRE and CEGUI.
This is how I start the system:
Code: Select all
// Set the rendering options
mOgreRenderer = new OgreRenderer(GameMain::getSingleton().getWindow(), RENDER_QUEUE_OVERLAY, false, 3000, GameMain::getSingleton().getSceneMgr());
// Create the GUI system
new System(mOgreRenderer);
...and this is how I end it:
Code: Select all
delete CEGUI::System::getSingletonPtr();
if (mOgreRenderer)
{
delete mOgreRenderer;
}
Now, I have two problems/questions.
Using line like this
Code: Select all
CEGUI::SchemeManager::getSingleton().loadScheme((utf8*)"TaharezLook.scheme");
This snippet
Code: Select all
CEGUI::Font* gfont = CEGUI::FontManager::getSingleton().createFont((utf8*)"Tahoma-12", (utf8*)"tahoma.ttf", 14, 0);
gfont->setAutoScalingEnabled(true);
gfont->setNativeResolution(CEGUI::Size(800, 600));
however gives an assert (_BLOCK_TYPE_IS_VALID(pHead->nBlockUse) ) on the delete CEGUI::System::getSingletonptr() line when I try to exit in debug.
Log:
Code: Select all
16/00/2005 02:52:34 (InfL1) ---- Begining cleanup of Font system ----
16/00/2005 02:52:34 (InfL2) Imageset 'Tahoma-12_auto_glyph_images' has been destroyed.
And that's it. Normally the line "Font 'Tahoma-12' has been destroyed." should follow.
I have a feeling the second one is thanks to my messup, just with all these changes lately I wondered if anyone else experienced them. If this was already noted somewhere... sorryyy, I tried searching
EDIT: Oh and I use the latest stable releases in both OGRE and CEGUI.