summaryrefslogtreecommitdiffstats
path: root/osdep
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2013-12-07 15:15:54 +0100
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2013-12-07 15:29:53 +0100
commitb454cc0ca34424101f7e4ba922983cbc44976641 (patch)
tree4663d316d77d01225df3ee6f41f9b506779210d5 /osdep
parent8f3d0b5e532a1dfb52145875d4ee4376d0e0188b (diff)
downloadmpv-b454cc0ca34424101f7e4ba922983cbc44976641.tar.bz2
mpv-b454cc0ca34424101f7e4ba922983cbc44976641.tar.xz
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.
Diffstat (limited to 'osdep')
-rw-r--r--osdep/macosx_events.m5
1 files changed, 4 insertions, 1 deletions
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