]> git.saurik.com Git - wxWidgets.git/commitdiff
Call -[NSApplication stop] instead of terminate. The stop message will
authorDavid Elliott <dfe@tgwbd.org>
Mon, 14 Jul 2003 02:46:12 +0000 (02:46 +0000)
committerDavid Elliott <dfe@tgwbd.org>
Mon, 14 Jul 2003 02:46:12 +0000 (02:46 +0000)
return to the caller allowing processing to continue until all events
have been processed.  Make sure that no more idle events are installed
by checking -[NSApplication isRunning].

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@21944 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/cocoa/app.mm

index b9777b21372e84c199519555ed5c1c86e7f3cf15..baf11a863688c99dd9eb2470216a8b5627b2202e 100644 (file)
@@ -195,6 +195,9 @@ wxApp::wxApp()
 
 void wxApp::CocoaInstallIdleHandler()
 {
+    // If we're supposed to be stopping, don't add more idle events
+    if(![m_cocoaApp isRunning])
+        return;
     wxLogDebug("wxApp::CocoaInstallIdleHandler");
     m_isIdle = false;
     // Call doIdle for EVERYTHING dammit
@@ -260,7 +263,7 @@ void wxApp::ExitMainLoop()
     if(!m_isIdle)
         [[ NSRunLoop currentRunLoop ] cancelPerformSelector:@selector(doIdle:) target:m_cocoaApp argument:NULL];
 #endif
-    [m_cocoaApp terminate: m_cocoaApp];
+    [m_cocoaApp stop: m_cocoaApp];
 }
 
 // Is a message/event pending?