From 81fb0d16ad1ff159a9e5a46edb90046683a36900 Mon Sep 17 00:00:00 2001 From: Michael Buckley Date: Sun, 10 Nov 2019 13:23:44 -0800 Subject: [PATCH] Mac: fix pausing emulation when window is closed --- macosx/Snes9x/AppDelegate.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/macosx/Snes9x/AppDelegate.m b/macosx/Snes9x/AppDelegate.m index 86274e1d..4f999eeb 100644 --- a/macosx/Snes9x/AppDelegate.m +++ b/macosx/Snes9x/AppDelegate.m @@ -65,12 +65,12 @@ static NSWindowFrameAutosaveName const kMainWindowIdentifier = @"s9xMainWindow"; [window center]; } + self.window = window; + [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 {