reverted the delete/Destroy() change in DestroyChildren()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23619 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -83,16 +83,6 @@ bool wxTopLevelWindowBase::Destroy()
|
|||||||
// but hide it immediately
|
// but hide it immediately
|
||||||
Hide();
|
Hide();
|
||||||
|
|
||||||
// also remove it from the list of parents children so that the loop in
|
|
||||||
// wxWindowBase::DestroyChildren() eventually terminates
|
|
||||||
if ( m_parent )
|
|
||||||
{
|
|
||||||
m_parent->RemoveChild(this);
|
|
||||||
|
|
||||||
// don't do it again in our dtor
|
|
||||||
m_parent = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -348,7 +348,11 @@ bool wxWindowBase::DestroyChildren()
|
|||||||
|
|
||||||
wxWindow *child = node->GetData();
|
wxWindow *child = node->GetData();
|
||||||
|
|
||||||
child->Destroy();
|
// note that we really want to call delete and not ->Destroy() here
|
||||||
|
// because we want to delete the child immediately, before we are
|
||||||
|
// deleted, and delayed deletion would result in problems as our (top
|
||||||
|
// level) child could outlive its parent
|
||||||
|
delete child;
|
||||||
|
|
||||||
wxASSERT_MSG( !GetChildren().Find(child),
|
wxASSERT_MSG( !GetChildren().Find(child),
|
||||||
wxT("child didn't remove itself using RemoveChild()") );
|
wxT("child didn't remove itself using RemoveChild()") );
|
||||||
|
Reference in New Issue
Block a user