macosx_events: fix crash when shutting down during window animations

This commit is contained in:
Rodger Combs authored and Akemi committed 2019-03-13 19:44:34 +01:00
1 parent ec0b5e527b
commit 4fd3af14cd
1 file changed
+3 -1
+3 -1
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;