Mac: fix pausing emulation when window is closed

This commit is contained in:
Michael Buckley 2019-11-10 13:23:44 -08:00
parent bb619e5597
commit 81fb0d16ad
1 changed files with 3 additions and 3 deletions

View File

@ -65,12 +65,12 @@ static NSWindowFrameAutosaveName const kMainWindowIdentifier = @"s9xMainWindow";
[window center]; [window center];
} }
self.window = window;
[NSNotificationCenter.defaultCenter addObserverForName:NSWindowWillCloseNotification object:window queue:NSOperationQueue.mainQueue usingBlock:^(NSNotification *notification) [NSNotificationCenter.defaultCenter addObserverForName:NSWindowWillCloseNotification object:window queue:NSOperationQueue.mainQueue usingBlock:^(NSNotification *notification)
{ {
[self.s9xEngine stop]; [self.s9xEngine pause];
}]; }];
self.window = window;
} }
- (void)applicationWillTerminate:(NSNotification *)aNotification { - (void)applicationWillTerminate:(NSNotification *)aNotification {