From f56e8d85ec80847d806c96f0a31e89f108428a7f Mon Sep 17 00:00:00 2001 From: auria Date: Sun, 16 Oct 2011 00:07:28 +0000 Subject: [PATCH] Fix for good CGUIEditBox leak git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9991 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/guiengine/modaldialog.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/guiengine/modaldialog.cpp b/src/guiengine/modaldialog.cpp index cab0162c9..b36deeed8 100644 --- a/src/guiengine/modaldialog.cpp +++ b/src/guiengine/modaldialog.cpp @@ -148,25 +148,16 @@ ModalDialog::~ModalDialog() void ModalDialog::clearWindow() { - // TODO: extract this code and its eqauivalent from Screen into the common base class? Widget* w; for_in (w, m_widgets) { m_irrlicht_window->removeChild( w->getIrrlichtElement() ); } + elementsWereDeleted(); m_widgets.clearAndDeleteAll(); m_irrlicht_window->remove(); - m_irrlicht_window = GUIEngine::getGUIEnv()->addWindow ( m_area, true /* modal */ ); - - /* - const core::list& remainingChildren = m_irrlicht_window->getChildren(); - const int amount = remainingChildren.getSize(); - for(core::list::Iterator it=remainingChildren.begin(); it != remainingChildren.end(); it++) - { - it->remove(); - } - */ + m_irrlicht_window = GUIEngine::getGUIEnv()->addWindow( m_area, true /* modal */ ); } // ----------------------------------------------------------------------------