Page 1 of 1

Unload and reload CEGUI

Posted: Wed May 17, 2006 13:20
by eXt
I need to unload CEGUI completley and reload it at a later stage in my application. But when I load it the second time it crashes at this:

Code: Select all

CEGUI::SchemeManager::getSingletonPtr()->loadScheme((CEGUI::utf8*)"TaharezLook.scheme");


I think I unload everything correctly by destrying windows, the OGRE scenemanager and unloading the schemes.

How should I unload and reload CEGUI?

Posted: Wed May 17, 2006 16:47
by lindquist
The easiest way to completely unload CEGUI would be to:

Code: Select all

delete CEGUI::System::getSingletonPtr();

You may want to destroy the Ogre CEGUI renderer as well.

Posted: Wed May 17, 2006 17:21
by eXt
I get an exception when deleting CEGUI like that:

"WindowFactoryManager::getFactory - A WindowFactory object, an alias, or mapping for 'TaharezLook/StaticImage' Window objects is not registered with the system."

Should I free the windows myself before I delete them or not?

Posted: Wed May 17, 2006 17:31
by lindquist
deleting System will clear all loaded gui resources, including scheme, windows, imageset and so on...

That error should not occur.