0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00

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.
This commit is contained in:
Stefano Pigozzi 2013-05-12 20:29:23 +02:00
parent 6000e8f206
commit 6a83ef1552

View File

@ -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