]> git.saurik.com Git - wxWidgets.git/commitdiff
fix for the bug introduced by the last commit: don't quit the program when a standard...
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 16 Aug 2002 00:44:03 +0000 (00:44 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 16 Aug 2002 00:44:03 +0000 (00:44 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16532 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/toplevel.h
src/common/toplvcmn.cpp

index 84ac5bffeb70f827c8d8f47da0213d6b6062e4e2..3b33682aa693c1965588b690abaa288ab2fd78c1 100644 (file)
@@ -140,9 +140,9 @@ protected:
     virtual bool IsOneOfBars(const wxWindow *WXUNUSED(win)) const
         { return FALSE; }
 
-    // check if we should exit the program after deleting another top level
+    // check if we should exit the program after deleting this top level
     // window (this is used in common dtor and wxMSW code)
-    static bool IsLastBeforeExit();
+    bool IsLastBeforeExit() const;
 
     // send the iconize event, return TRUE if processed
     bool SendIconizeEvent(bool iconized = TRUE);
index 1f13c2535a89798f99dcaf1cb6380b45cae6f50d..f5386f9835865f904a21eb1d0aa98b18921a2d1d 100644 (file)
@@ -86,12 +86,12 @@ bool wxTopLevelWindowBase::Destroy()
     return TRUE;
 }
 
-/* static */
-bool wxTopLevelWindowBase::IsLastBeforeExit()
+bool wxTopLevelWindowBase::IsLastBeforeExit() const
 {
     // we exit the application if there are no more top level windows left
     // normally but wxApp can prevent this from happening
-    return (wxTopLevelWindows.GetCount() == 1) &&
+    return wxTopLevelWindows.GetCount() == 1 &&
+            wxTopLevelWindows.GetFirst()->GetData() == (wxWindow *)this &&
             wxTheApp && wxTheApp->GetExitOnFrameDelete();
 }