Fix crash when Destroy()-ing a TLW with a non-TLW parent.

Generalize the code in wxTopLevelWindowBase dtor checking for the children of
the TLW being destroyed pending for deletion themselves to work when the child
TLW is an indirect child, i.e. was created with a child window of this TLW as
parent and not this TLW itself.

Closes #15743.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75342 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2013-12-03 14:53:56 +00:00
parent 50805a002a
commit 0eae308634

View File

@@ -76,7 +76,7 @@ wxTopLevelWindowBase::~wxTopLevelWindowBase()
)
{
wxWindow * const win = wxDynamicCast(*i, wxWindow);
if ( win && win->GetParent() == this )
if ( win && wxGetTopLevelParent(win->GetParent()) == this )
{
wxPendingDelete.erase(i);