[input] Fix possible segfault-on-exit

Could occur if killed during playback (because input_stop() is async, thus
referencing cmdbase after it is destroyed)
This commit is contained in:
ejurgensen 2021-04-22 17:00:36 +02:00
parent e3213066ce
commit 89807b61ed
1 changed files with 7 additions and 2 deletions

View File

@ -842,6 +842,12 @@ input_stop(void)
commands_exec_async(cmdbase, stop_cmd, NULL);
}
static void
input_stop_sync(void)
{
commands_exec_sync(cmdbase, stop_cmd, NULL, NULL);
}
void
input_flush(short *flags)
{
@ -929,8 +935,7 @@ input_deinit(void)
int i;
int ret;
// TODO ok to do from here?
input_stop();
input_stop_sync();
for (i = 0; inputs[i]; i++)
{