mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-07 04:42:58 -05:00
[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:
@@ -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++)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user