You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers. No questions about C++ programming or topics which are answered in the tutorials!
parent = new gui::IGUIElement(gui::EGUIET_ELEMENT, env, gui_root, menu_id, screen_rect);
parent->drop();
parent->setVisible(false);
it works and the ref.counter is 1 at this point here, but the parent is -NOT- deleted when the app. exits causing a mem leak. anyone got an idea? thanks
well... if you set the pointer to NULL, nothing will be deleted.
and you are definitely allowed to call setVisible after having dropped the object.
@isogod:
how do you know the object is not destroyed at the end?
i do it the same way and never noticed mem leaks.
*sigh* i had a look into the doc, and, wow suprise, iguienvironment is derived from iguielement, means it is the root node itself, and if a guielement is destroyed, it drops its children.
It works just fine here... I get no leak messages. If you wanted to verify that everything gets cleaned up, set a breakpoint in the IGUIElement destructor. You would hit the breakpoint twice [once for the environment and once for the empty element].
It sounds like you are holding a reference to the element somewhere else and that is preventing it from being deleted when the environment is cleaned up.