mirror of
https://github.com/mpv-player/mpv
synced 2025-04-11 04:01:31 +00:00
player: adjust uninit order of components
Most things should be allowed to access the client API unconditionally (for example for sending events), so move destroying the client API down. Also, mp_uninit_ipc() should happen before the point at which all clients are shutdown, or there will be a small time window in which new clients can be created after destroying them all.
This commit is contained in:
parent
986d15ea9c
commit
db86eaad3d
@ -114,11 +114,15 @@ static void shutdown_clients(struct MPContext *mpctx)
|
|||||||
mp_dispatch_queue_process(mpctx->dispatch, 0);
|
mp_dispatch_queue_process(mpctx->dispatch, 0);
|
||||||
mp_wait_events(mpctx, 10000);
|
mp_wait_events(mpctx, 10000);
|
||||||
}
|
}
|
||||||
mp_clients_destroy(mpctx);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void mp_destroy(struct MPContext *mpctx)
|
void mp_destroy(struct MPContext *mpctx)
|
||||||
{
|
{
|
||||||
|
#if !defined(__MINGW32__)
|
||||||
|
mp_uninit_ipc(mpctx->ipc_ctx);
|
||||||
|
mpctx->ipc_ctx = NULL;
|
||||||
|
#endif
|
||||||
|
|
||||||
shutdown_clients(mpctx);
|
shutdown_clients(mpctx);
|
||||||
|
|
||||||
uninit_audio_out(mpctx);
|
uninit_audio_out(mpctx);
|
||||||
@ -131,13 +135,10 @@ void mp_destroy(struct MPContext *mpctx)
|
|||||||
|
|
||||||
mpctx->encode_lavc_ctx = NULL;
|
mpctx->encode_lavc_ctx = NULL;
|
||||||
|
|
||||||
#if !defined(__MINGW32__)
|
|
||||||
mp_uninit_ipc(mpctx->ipc_ctx);
|
|
||||||
mpctx->ipc_ctx = NULL;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
command_uninit(mpctx);
|
command_uninit(mpctx);
|
||||||
|
|
||||||
|
mp_clients_destroy(mpctx);
|
||||||
|
|
||||||
osd_free(mpctx->osd);
|
osd_free(mpctx->osd);
|
||||||
|
|
||||||
if (mpctx->opts->use_terminal && terminal_initialized) {
|
if (mpctx->opts->use_terminal && terminal_initialized) {
|
||||||
|
Loading…
Reference in New Issue
Block a user