From 9617f65bccba124625546fd798e03e59d97b35c9 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 6 Feb 2008 13:56:23 +0000 Subject: [PATCH] fix GetTLWParentIfNotBeingDeleted() to work correctly even if an intermediate non-TLW parent is being deleted, it should still return the TLW parent and not NULL in this case, otherwise we'd crash when a button child of a panel being deleted is current temporary default button git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51570 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/button.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/msw/button.cpp b/src/msw/button.cpp index 64e4790923..45f6b37795 100644 --- a/src/msw/button.cpp +++ b/src/msw/button.cpp @@ -376,11 +376,12 @@ static wxTopLevelWindow *GetTLWParentIfNotBeingDeleted(wxWindow *win) { for ( ; win; win = win->GetParent() ) { - if ( win->IsBeingDeleted() ) - return NULL; - if ( win->IsTopLevel() ) + { + if ( win->IsBeingDeleted() ) + return NULL; break; + } } wxASSERT_MSG( win, _T("button without top level parent?") ); -- 2.45.2