]> git.saurik.com Git - wxWidgets.git/commitdiff
fix GetTLWParentIfNotBeingDeleted() to work correctly even if an intermediate non...
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 6 Feb 2008 13:56:23 +0000 (13:56 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 6 Feb 2008 13:56:23 +0000 (13:56 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51570 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/button.cpp

index 64e4790923f850f59a30868f7ac0d3e60240887a..45f6b377957936f2e8c18f485bc4e60619380ebf 100644 (file)
@@ -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?") );