Page 1 of 1

Destruction of CEGUI

Posted: Thu Jan 18, 2007 16:33
by Sjizo
Hey all,

I was wondering id there is a special call you can make that destructs all objects that CEGUI made. I now do the following:

Code: Select all

CEGUI::TCEGuiEximionRenderer* renderer = new CEGUI::TCEGuiEximionRenderer(width,height);
      CEGUI::LuaScriptModule* scriptModule = new CEGUI::LuaScriptModule( safeCast(TLuaApi*, engine.getScriptingAgentRef()->getApi() )->getLuaState());
      new CEGUI::System(renderer,NULL,NULL,scriptModule,(CEGUI::utf8*)"../assets/interface/datafiles/configs/cegui.config");


And when closing the application i do

delete CEGUI::System::getSingletonPtr()

But this still leaves a memory leak.

Posted: Mon Jan 22, 2007 12:36
by vasmann
Hello.
As I know - System is the singleton, and singletons are never destroyed, if there is no interface for such actions.

And why are you worry about destruction of System - it will automatically free when application will close.

Thank You.

Posted: Mon Jan 22, 2007 17:24
by lindquist
R = new Renderer;
L = new Lua;
S = new System;

....


delete S;
delete L;
delete R;


HTH