From f88f1fca3f0d49e3712bde3fdb3d328172f68be5 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 19 Feb 2017 20:40:06 +0100 Subject: [PATCH] output/httpd: move Close() lock into the I/O thread Fixes a potential deadlock introduced by commit 945287358b6 --- src/output/plugins/httpd/HttpdOutputPlugin.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/output/plugins/httpd/HttpdOutputPlugin.cxx b/src/output/plugins/httpd/HttpdOutputPlugin.cxx index 5197d77e4..2785b8a6a 100644 --- a/src/output/plugins/httpd/HttpdOutputPlugin.cxx +++ b/src/output/plugins/httpd/HttpdOutputPlugin.cxx @@ -266,14 +266,13 @@ HttpdOutput::Open(AudioFormat &audio_format) inline void HttpdOutput::Close() { - const std::lock_guard protect(mutex); - assert(open); - open = false; delete timer; BlockingCall(GetEventLoop(), [this](){ + const std::lock_guard protect(mutex); + open = false; clients.clear_and_dispose(DeleteDisposer()); });