[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:
parent
e3213066ce
commit
89807b61ed
|
@ -842,6 +842,12 @@ input_stop(void)
|
||||||
commands_exec_async(cmdbase, stop_cmd, NULL);
|
commands_exec_async(cmdbase, stop_cmd, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
input_stop_sync(void)
|
||||||
|
{
|
||||||
|
commands_exec_sync(cmdbase, stop_cmd, NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
input_flush(short *flags)
|
input_flush(short *flags)
|
||||||
{
|
{
|
||||||
|
@ -929,8 +935,7 @@ input_deinit(void)
|
||||||
int i;
|
int i;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
// TODO ok to do from here?
|
input_stop_sync();
|
||||||
input_stop();
|
|
||||||
|
|
||||||
for (i = 0; inputs[i]; i++)
|
for (i = 0; inputs[i]; i++)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue