memory leak

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

gjaegy
Just popping in
Just popping in
Posts: 14
Joined: Thu Mar 04, 2010 12:18

memory leak

Postby gjaegy » Thu Oct 04, 2012 07:15

Hi,

I am using the latest source code (1.x branch) from the repository. I am having some issue trying to fix a memory leak, which I think might be a Cegui internal leak.

Below the leaks produced :

http://g.jaegy.free.fr/_divers/leaks.txt

The leak can be reproduced using the simple code below:

Code: Select all

      CEGUI::System& system = CEGUI::System::getSingleton();
      CEGUI::SchemeManager& schemeMgr = CEGUI::SchemeManager::getSingleton();
      CEGUI::WindowManager& winMgr = CEGUI::WindowManager::getSingleton();

      CEGUI::Scheme& scheme = schemeMgr.createFromFile("AlfiskoSkin.scheme");;
      CEGUI::Window* window = winMgr.loadLayoutFromFile("ADTTuning.layout");
      CEGUI::Window* root = system.getDefaultGUIContext().getRootWindow();
      root->addChild(window);
      root->removeChild(window);
      winMgr.destroyWindow(window);


Below is the simple layout file used:
http://g.jaegy.free.fr/_divers/ADTTuning.layout

The leak seems to be created when the "UnifiedDim::clone()" method gets called by the expat parser, while loading the .scheme file:

Code: Select all

BaseDim* UnifiedDim::clone() const
{
    UnifiedDim* ndim = CEGUI_NEW_AO UnifiedDim(d_value, d_what);
    return ndim;
}


This method being called by OperatorDim::setNextOperand().

I would say that the OperatorDim class should have a destructor, which delete its "d_left" and "d_right" members, no ?

Any idea ?

Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 0 guests