summaryrefslogtreecommitdiffstats
path: root/player/main.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-02-12 18:39:47 +0100
committerwm4 <wm4@nowhere>2015-02-12 21:18:23 +0100
commitc59a4f12db96784b054f28d52eaa33cb7553d630 (patch)
tree95dbb9439caa7eeaa25185d1f9f2ce7d7f7414ca /player/main.c
parentb8de478f51fdd9982482f8e9f3502a5e0d97f31c (diff)
downloadmpv-c59a4f12db96784b054f28d52eaa33cb7553d630.tar.bz2
mpv-c59a4f12db96784b054f28d52eaa33cb7553d630.tar.xz
osx: move code to unset input context to the right place
Setting the input context is always called, both in cplayer and libmpv, and under HAVE_COCOA. Unsetting the input context was done only the cplayer uninit call. Also it was under HAVE_COCOA_APPLICATION, so it was not unset in libmpv (dangling pointer).
Diffstat (limited to 'player/main.c')
-rw-r--r--player/main.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/player/main.c b/player/main.c
index 118aef9eed..4a8f723bb2 100644
--- a/player/main.c
+++ b/player/main.c
@@ -164,6 +164,10 @@ void mp_destroy(struct MPContext *mpctx)
osd_free(mpctx->osd);
+#if HAVE_COCOA
+ cocoa_set_input_context(NULL);
+#endif
+
if (cas_terminal_owner(mpctx, mpctx)) {
terminal_uninit();
cas_terminal_owner(mpctx, NULL);
@@ -183,10 +187,6 @@ void mp_destroy(struct MPContext *mpctx)
static int prepare_exit_cplayer(struct MPContext *mpctx, enum exit_reason how)
{
-#if HAVE_COCOA_APPLICATION
- cocoa_set_input_context(NULL);
-#endif
-
int rc = 0;
const char *reason = NULL;