From 3d714e03c1d79b1d8ee2d0f1a03f4ea5a0c1fc1d Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sat, 9 May 2015 00:37:24 -0400 Subject: [PATCH] Laid down the scaffolding for application termination on Mac OS X. --- darwin/init.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/darwin/init.m b/darwin/init.m index 15bd2c71..db5cf8f4 100644 --- a/darwin/init.m +++ b/darwin/init.m @@ -1,6 +1,8 @@ // 6 april 2015 #import "uipriv_darwin.h" +static BOOL canQuit = NO; + @interface applicationClass : NSApplication @end @@ -17,6 +19,9 @@ // for debugging NSLog(@"in terminate:"); + + if (!canQuit) + complain("call to [NSApp terminate:] when not ready to terminate"); } @end @@ -33,6 +38,7 @@ { // for debugging NSLog(@"in applicationShouldTerminate:"); + canQuit = YES; return NSTerminateNow; }