mirror of
https://github.com/mpv-player/mpv
synced 2025-01-11 17:39:38 +00: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:
parent
6000e8f206
commit
6a83ef1552
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user