Index: /trunk/ccl/examples/cocoa-window.lisp
===================================================================
--- /trunk/ccl/examples/cocoa-window.lisp	(revision 5540)
+++ /trunk/ccl/examples/cocoa-window.lisp	(revision 5541)
@@ -115,13 +115,6 @@
 	      :wait-until-done t)))))
 
-#+apple-objc
-(define-objc-method ("_shouldTerminate" lisp-application)
-  (:<BOOL>)
-  (with-slots (termp) self
-      (setq termp (objc-message-send-super (super) "_shouldTerminate" :<BOOL>))))
-
-(define-objc-method ((:<BOOL> termp) lisp-application)
-  (with-slots (termp) self
-      termp))
+
+
 
 (defloadvar *default-ns-application-proxy-class-name*
@@ -186,8 +179,5 @@
 	(send (the ns-application self) :stop (%null-ptr))))))
 
-(define-objc-method ((:void :terminate sender)
-		     lisp-application)
-  (declare (ignore sender))
-  (quit))
+
 
 (define-objc-method ((:void :show-preferences sender) lisp-application)
@@ -207,28 +197,10 @@
 
 
-#+apple-objc
-(defmethod process-verify-quit ((process appkit-process))
-  (let* ((app *NSApp*))
-    (or
-     (null app)
-     (not (send app 'is-running))
-     (eql (pref app :<NSA>pplication._app<F>lags._app<D>ying) #$YES)
-     (eql (pref app
-		:<NSA>pplication._app<F>lags._dont<S>end<S>hould<T>erminate)
-	  #$YES)
-     (progn
-       (send
-	app
-	:perform-selector-on-main-thread (@selector "_shouldTerminate")
-	:with-object (%null-ptr)
-	:wait-until-done t)
-       (send app 'termp)))))
-
-#+apple-objc
+
+
 (defmethod process-exit-application ((process appkit-process) thunk)
   (when (eq process *initial-process*)
-    (prepare-to-quit)
     (%set-toplevel thunk)
-    (send (the lisp-application *NSApp*) 'shutdown)
+    (send (the lisp-application *NSApp*) :terminate (%null-ptr))
     ))
 
Index: /trunk/ccl/examples/cocoa.lisp
===================================================================
--- /trunk/ccl/examples/cocoa.lisp	(revision 5540)
+++ /trunk/ccl/examples/cocoa.lisp	(revision 5541)
@@ -30,4 +30,10 @@
   (declare (ignore notification))
   (initialize-user-interface))
+
+(define-objc-method ((:void :application-will-terminate (:id notification))
+                     lisp-application-delegate)
+  (declare (ignore notification))
+  ;; UI has decided to quit; terminate other lisp threads.
+  (prepare-to-quit))
 
 (define-objc-method ((:void :new-listener sender) lisp-application-delegate)
