From 5eaf2b8fc3736f73df433c81fbca0941d184f7c5 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 12 Nov 2018 12:21:59 +0100 Subject: output/control: always close the `AudioOutputSource` in `RELEASE` Fixes a crash bug with `always_on` outputs which occurs because the `AudioOutputSource` still has a pointer to an outdated `MusicChunk`. Fixes #415 --- src/output/Thread.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/output/Thread.cxx') diff --git a/src/output/Thread.cxx b/src/output/Thread.cxx index b88eecbad..b0556b34d 100644 --- a/src/output/Thread.cxx +++ b/src/output/Thread.cxx @@ -467,7 +467,12 @@ AudioOutputControl::Task() noexcept if (always_on) { /* in "always_on" mode, the output is - paused instead of being closed */ + paused instead of being closed; + however we need to close the + AudioOutputSource because its data + have been invalidated by stopping + the actual playback */ + source.Close(); InternalPause(); } else { InternalClose(false); -- cgit v1.2.3