From 4fd3af14cd6cd13492cf4af6cfdbd6489de58ab2 Mon Sep 17 00:00:00 2001 From: Rodger Combs Date: Tue, 12 Mar 2019 21:00:50 -0500 Subject: [PATCH] macosx_events: fix crash when shutting down during window animations --- osdep/macosx_events.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osdep/macosx_events.m b/osdep/macosx_events.m index a354378777..68956de43e 100644 --- a/osdep/macosx_events.m +++ b/osdep/macosx_events.m @@ -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;