From 6a83ef1552de4a1a71da49e45647ce1a4ce64e53 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 12 May 2013 20:29:23 +0200 Subject: macosx_application: fix crash when quitting player mpv crashed on quit when it was run using the bundle functionality and started without any files thus waiting for file open events. In that case, since there is no key_fifo initialized yet, short circuit to `terminate_cocoa_application()` which is generally called from `exit_player()` during normal lifecycle. Fixes bug report from user `eng` on IRC. --- osdep/macosx_application.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/osdep/macosx_application.m b/osdep/macosx_application.m index 8f237dd13a..77c51a5180 100644 --- a/osdep/macosx_application.m +++ b/osdep/macosx_application.m @@ -120,7 +120,11 @@ static pthread_t playback_thread_id; - (void)stopPlayback { - mplayer_put_key(app.keyFIFO, MP_KEY_CLOSE_WIN); + if (app.keyFIFO) { + mplayer_put_key(app.keyFIFO, MP_KEY_CLOSE_WIN); + } else { + terminate_cocoa_application(); + } } - (void)registerMenuItem:(NSMenuItem*)menuItem forKey:(MPMenuKey)key -- cgit v1.2.3