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.
This commit is contained in:
Kacper Michajłow 2024-03-17 12:52:38 +01:00
parent 8ee25db71f
commit c1282d4d43
1 changed files with 6 additions and 5 deletions

View File

@ -184,16 +184,17 @@ void mp_destroy(struct MPContext *mpctx)
cocoa_set_input_context(NULL); cocoa_set_input_context(NULL);
#endif #endif
if (cas_terminal_owner(mpctx, mpctx)) {
terminal_uninit();
cas_terminal_owner(mpctx, NULL);
}
mp_input_uninit(mpctx->input); mp_input_uninit(mpctx->input);
uninit_libav(mpctx->global); uninit_libav(mpctx->global);
mp_msg_uninit(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); assert(!mpctx->num_abort_list);
talloc_free(mpctx->abort_list); talloc_free(mpctx->abort_list);
mp_mutex_destroy(&mpctx->abort_lock); mp_mutex_destroy(&mpctx->abort_lock);