Commit eb93bebb authored by Max Kellermann's avatar Max Kellermann

MusicBuffer: fix potential deadlock while cross-fading in Return()

parent 2be905b2
......@@ -39,6 +39,12 @@ MusicBuffer::Return(MusicChunk *chunk) noexcept
{
assert(chunk != nullptr);
/* these attributes need to be cleared before locking the
mutex, because they might recursively call this method,
causing a deadlock */
chunk->next.reset();
chunk->other.reset();
const std::lock_guard<Mutex> protect(mutex);
assert(!chunk->other || !chunk->other->other);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment