From b454cc0ca34424101f7e4ba922983cbc44976641 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sat, 7 Dec 2013 15:15:54 +0100 Subject: macosx_events: fix null dereference on uninit Bug introduced by commit 6fb020f5. It doesn't always happen, since it is caused by the playloop and cocoa UI code running in separate threads. Fixes #398. --- osdep/macosx_events.m | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'osdep') diff --git a/osdep/macosx_events.m b/osdep/macosx_events.m index 4831904aa7..a7ca335736 100644 --- a/osdep/macosx_events.m +++ b/osdep/macosx_events.m @@ -176,7 +176,10 @@ void cocoa_put_key_with_modifiers(int keycode, int modifiers) - (BOOL)useAltGr { - return mp_input_use_alt_gr(mpv_shared_app().inputContext); + if (mpv_shared_app().inputContext) + return mp_input_use_alt_gr(mpv_shared_app().inputContext); + else + return YES; } - (void)startAppleRemote -- cgit v1.2.3