X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ecdc118383f458bd7e684ab631f6e5d23cc6d251..24af522c4378db219f13146f8bfe22fe790aad0f:/src/common/wincmn.cpp diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index b9942fa0a8..c40aa1d746 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -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); @@ -2638,7 +2641,10 @@ void wxWindowBase::ReleaseMouse() wxASSERT_MSG( !ms_winCaptureChanging, _T("recursive ReleaseMouse call?") ); - wxASSERT_MSG( GetCapture() == this, wxT("attempt to release mouse, but this window hasn't captured it") ); + wxASSERT_MSG( GetCapture() == this, + "attempt to release mouse, but this window hasn't captured it" ); + wxASSERT_MSG( ms_winCaptureCurrent == this, + "attempt to release mouse, but this window hasn't captured it" ); ms_winCaptureChanging = true;