diff --git a/stepmania/PBProject/SMMain.mm b/stepmania/PBProject/SMMain.mm index 8541d2d94a..2a5028fc25 100755 --- a/stepmania/PBProject/SMMain.mm +++ b/stepmania/PBProject/SMMain.mm @@ -21,6 +21,7 @@ } - (id) initWithArgc:(int)argc argv:(char **)argv; - (void) startGame:(id)sender; +- (NSApplicationTerminateReply) applicationShouldTerminate:(NSApplication *)sender; @end @@ -29,11 +30,6 @@ { ArchHooks::SetToggleWindowed(); } -// Invoked from the Quit menu item. -- (void)terminate:(id)sender -{ - ArchHooks::SetUserQuit(); -} - (void)sendEvent:(NSEvent *)event { @@ -66,6 +62,12 @@ { [NSThread detachNewThreadSelector:@selector(startGame:) toTarget:self withObject:nil]; } + +- (NSApplicationTerminateReply) applicationShouldTerminate:(NSApplication *)sender +{ + ArchHooks::SetUserQuit(); + return NSTerminateCancel; +} @end static void HandleNSException( NSException *exception ) @@ -132,7 +134,7 @@ int main( int argc, char **argv ) [SMApplication poseAsClass:[NSApplication class]]; NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - SMMain *sm; + SMMain *sm; // Ensure the application object is initialised, this sets NSApp. [SMApplication sharedApplication];