Destroying Windows - Remove from parent First?
Posted: Sun Apr 30, 2006 17:30
Before destroying a window, is it required to remove it from the parent first?
In other words, is this OK?
or should it really be done as so:
In other words, is this OK?
Code: Select all
mRootWindow = mWinMgr.loadWindowLayout( (CEGUI::utf8*)"Intro.xml");
CEGUI::System::getSingleton().getGUISheet()->addChildWindow( mRootWindow );
... later in life ...
if ( mRootWindow )
CEGUI::WindowManager::getSingleton().destroyWindow( mRootWindow );
or should it really be done as so:
Code: Select all
... later in life ...
if ( mRootWindow )
{
CEGUI::System::getSingleton().getGUISheet()->removeChildWindow( mRootWindow );
CEGUI::WindowManager::getSingleton().destroyWindow( mRootWindow );
}