fix an assert failure when a child TLW was created and destroyed while the parent window was frozen

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54984 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2008-08-05 22:47:11 +00:00
parent cf1c280f7f
commit 76be36e401

View File

@ -1007,7 +1007,7 @@ void wxWindowBase::AddChild(wxWindowBase *child)
GetChildren().Append((wxWindow*)child);
child->SetParent(this);
// adding a child while frozen will assert when thawn, so freeze it as if
// adding a child while frozen will assert when thawed, so freeze it as if
// it had been already present when we were frozen
if ( IsFrozen() && !child->IsTopLevel() )
child->Freeze();
@ -1019,7 +1019,10 @@ void wxWindowBase::RemoveChild(wxWindowBase *child)
// removing a child while frozen may result in permanently frozen window
// if used e.g. from Reparent(), so thaw it
if ( IsFrozen() && !child->IsTopLevel() )
//
// NB: IsTopLevel() doesn't return true any more when a TLW child is being
// removed from its ~wxWindowBase, so check for IsBeingDeleted() too
if ( IsFrozen() && !child->IsBeingDeleted() && !child->IsTopLevel() )
child->Thaw();
GetChildren().DeleteObject((wxWindow *)child);