Page 1 of 1

Some memory-management related problems

Posted: Sun Jan 16, 2005 02:37
by Assidragon
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:

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");
results in memory leaks, according to OgreLeaks.log (4 leaks, ogredatachunk.cpp(55) Ogre:: DataChunk::allocate).

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.

Re: Some memory-management related problems

Posted: Sun Jan 16, 2005 07:33
by CrazyEddie
If you're using the 0.1.0 release of CEGUI can you do a cvs update on the source; this will get you bug-fixes from that branch only; so is still considered stable. There was a fairly big bug that caused a lot of issues with memory that has been fixed. I'll try to get a set of bug-fix releases out next week.

If you already have the bug fixes via CVS and the problem persists, can you let me know which compiler version you are using, thanks.

CE.

Re: Some memory-management related problems

Posted: Sun Jan 16, 2005 10:46
by Assidragon
Updating to CVS fixed these, thanks a lot. :)

While here I'd like to say thanks for developing this great system :)

Re: Some memory-management related problems

Posted: Sun Jan 16, 2005 12:32
by CrazyEddie
No problem. I'm glad you're finding the system useful :)

Re: Some memory-management related problems

Posted: Sun Jan 16, 2005 12:39
by Assidragon
Hard not to actually. It does all what it has to and is quite flexible... the only drawback I found in CEGUI a while ago was the fact it had a seperate resource handling than OGRE so you had to mess with the directories, but now it's all fine. =)