Page 1 of 1

Destroying Windows - Remove from parent First?

Posted: Sun Apr 30, 2006 17:30
by Van
Before destroying a window, is it required to remove it from the parent first?

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 );
   }


Posted: Sun Apr 30, 2006 17:36
by lindquist
calling destroyWindow is just fine :)

Posted: Wed May 03, 2006 09:02
by vinny_the_true
just be aware that when you destroy a window, you destroy all of its children too.