summaryrefslogtreecommitdiffstats
path: root/player/main.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-05-12 18:46:37 +0200
committerwm4 <wm4@nowhere>2018-05-24 19:56:34 +0200
commite4fb23ed7de874bb2d05824d7edb84cfd1b21101 (patch)
treeff56d6949cdead5795607c86882ce44aca0b7da7 /player/main.c
parentce1f5e78c2b10e24c78d7ee65d7196093709b8ce (diff)
downloadmpv-e4fb23ed7de874bb2d05824d7edb84cfd1b21101.tar.bz2
mpv-e4fb23ed7de874bb2d05824d7edb84cfd1b21101.tar.xz
command: add a way to abort asynchronous commands
Many asynchronous commands are potentially long running operations, such as loading something from network or running a foreign process. Obviously it shouldn't just be possible for them to freeze the player if they don't terminate as expected. Also, there will be situations where you want to explicitly stop some of those operations explicitly. So add an infrastructure for this. Commands have to support this explicitly. The next commit uses this to actually add support to a command.
Diffstat (limited to 'player/main.c')
-rw-r--r--player/main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/player/main.c b/player/main.c
index d744c9cf12..c51f93a430 100644
--- a/player/main.c
+++ b/player/main.c
@@ -189,6 +189,8 @@ void mp_destroy(struct MPContext *mpctx)
uninit_libav(mpctx->global);
mp_msg_uninit(mpctx->global);
+ assert(!mpctx->num_abort_list);
+ talloc_free(mpctx->abort_list);
pthread_mutex_destroy(&mpctx->abort_lock);
talloc_free(mpctx);
}