summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--osdep/macosx_events.m4
1 files changed, 3 insertions, 1 deletions
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;