Destruction of CEGUI

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

Sjizo
Not too shy to talk
Not too shy to talk
Posts: 30
Joined: Thu Aug 31, 2006 08:44

Destruction of CEGUI

Postby Sjizo » Thu Jan 18, 2007 16:33

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.

User avatar
vasmann
Just popping in
Just popping in
Posts: 13
Joined: Thu Nov 09, 2006 17:19
Location: Ukrain, Kharkiv
Contact:

Postby vasmann » Mon Jan 22, 2007 12:36

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.

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Postby lindquist » Mon Jan 22, 2007 17:24

R = new Renderer;
L = new Lua;
S = new System;

....


delete S;
delete L;
delete R;


HTH


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 10 guests