macosx_events: fix crash when shutting down during window animations

This commit is contained in:
Rodger Combs 2019-03-12 21:00:50 -05:00 committed by Akemi
parent ec0b5e527b
commit 4fd3af14cd
1 changed files with 3 additions and 1 deletions

View File

@ -340,8 +340,10 @@ void cocoa_set_mpv_handle(struct mpv_handle *ctx)
switch (event->event_id) {
case MPV_EVENT_SHUTDOWN: {
#if HAVE_MACOS_COCOA_CB
if ([(Application *)NSApp cocoaCB].isShuttingDown)
if ([(Application *)NSApp cocoaCB].isShuttingDown) {
_ctx = nil;
return;
}
#endif
mpv_destroy(_ctx);
_ctx = nil;