Proper CEGUI shutdown / Valgrind
Posted: Fri Aug 12, 2011 21:20
Hi,
I was running Valgrind against a CEGUI-using program and saw a very large number of blocks that were still reachable (not true memory leaks). Indeed (like most available examples), no clean-up was down before halting the program. What is the recommended way of doing so with CEGUI? Are we supposed to remove all components (parser, scheme/font managers,resource providers, various singletons, etc.) each at a time, in reverse creation order? Is there a CEGUI::stop() or alike that I have missed?
Btw, Valgrind seems to hint at an error within mouse cursor management:
in:
Thanks in advance for any hint,
Olivier.
I was running Valgrind against a CEGUI-using program and saw a very large number of blocks that were still reachable (not true memory leaks). Indeed (like most available examples), no clean-up was down before halting the program. What is the recommended way of doing so with CEGUI? Are we supposed to remove all components (parser, scheme/font managers,resource providers, various singletons, etc.) each at a time, in reverse creation order? Is there a CEGUI::stop() or alike that I have missed?
Btw, Valgrind seems to hint at an error within mouse cursor management:
Code: Select all
==25267== Conditional jump or move depends on uninitialised value(s)
==25267== at 0x5FDBF89: CEGUI::MouseCursor::constrainPosition() (CEGUIMouseCursor.cpp:183)
==25267== by 0x5FDC1D3: CEGUI::MouseCursor::setConstraintArea(CEGUI::Rect const*) (CEGUIMouseCursor.cpp:221)
==25267== by 0x5FDC405: CEGUI::MouseCursor::MouseCursor() (CEGUIMouseCursor.cpp:73)
==25267== by 0x6007E42: CEGUI::System::createSingletons() (CEGUISystem.cpp:1504)
==25267== by 0x600AF8E: CEGUI::System::System(CEGUI::Renderer&, CEGUI::ResourceProvider*, CEGUI::XMLParser*, CEGUI::ImageCodec*, CEGUI::ScriptModule*, CEGUI::String const&, CEGUI::String const&) (CEGUISystem.cpp:294)
==25267== by 0x600B97C: CEGUI::System::create(CEGUI::Renderer&, CEGUI::ResourceProvider*, CEGUI::XMLParser*, CEGUI::ImageCodec*, CEGUI::ScriptModule*, CEGUI::String const&, CEGUI::String const&) (CEGUISystem.cpp:1891)
==25267== by 0x55EFA8E: CEGUI::OpenGLRenderer::bootstrapSystem(CEGUI::OpenGLRenderer::TextureTargetType) (CEGUIOpenGLRenderer.cpp:121)
in:
Code: Select all
void MouseCursor::constrainPosition(void)
{
Rect absarea(getConstraintArea());
if (d_position.d_x >= absarea.d_right)
d_position.d_x = absarea.d_right -1;
[..]
Thanks in advance for any hint,
Olivier.