From 0eae3086346818f38fe8d2ade0c393f6820598c3 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 3 Dec 2013 14:53:56 +0000 Subject: [PATCH] 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 --- src/common/toplvcmn.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/toplvcmn.cpp b/src/common/toplvcmn.cpp index b5d3e5e39d..03504cc0fe 100644 --- a/src/common/toplvcmn.cpp +++ b/src/common/toplvcmn.cpp @@ -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);