summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKacper Michajłow <kasper93@gmail.com>2024-03-17 12:52:38 +0100
committerKacper Michajłow <kasper93@gmail.com>2024-03-19 19:58:09 +0100
commitc1282d4d43be8fb8bbc8529b22804d288d59038a (patch)
tree0df51c188441117c4d630bdc04dc0a0386bbbe05
parent8ee25db71f0a47b09aedd5a24f9729a3f3ac6de3 (diff)
downloadmpv-c1282d4d43be8fb8bbc8529b22804d288d59038a.tar.bz2
mpv-c1282d4d43be8fb8bbc8529b22804d288d59038a.tar.xz
player/main: move terminal_uninit to the end
It is strange to do terminal_uninit() and still use terminal after. Even tho it has no side-effects.
-rw-r--r--player/main.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/player/main.c b/player/main.c
index 0458831f7c..09cce990bb 100644
--- a/player/main.c
+++ b/player/main.c
@@ -184,16 +184,17 @@ void mp_destroy(struct MPContext *mpctx)
cocoa_set_input_context(NULL);
#endif
- if (cas_terminal_owner(mpctx, mpctx)) {
- terminal_uninit();
- cas_terminal_owner(mpctx, NULL);
- }
-
mp_input_uninit(mpctx->input);
uninit_libav(mpctx->global);
mp_msg_uninit(mpctx->global);
+
+ if (cas_terminal_owner(mpctx, mpctx)) {
+ terminal_uninit();
+ cas_terminal_owner(mpctx, NULL);
+ }
+
assert(!mpctx->num_abort_list);
talloc_free(mpctx->abort_list);
mp_mutex_destroy(&mpctx->abort_lock);