output/httpd: move Close() lock into the I/O thread

Fixes a potential deadlock introduced by commit 945287358b
This commit is contained in:
Max Kellermann 2017-02-19 20:40:06 +01:00
parent 26e4a40cc7
commit f88f1fca3f

View File

@ -266,14 +266,13 @@ HttpdOutput::Open(AudioFormat &audio_format)
inline void
HttpdOutput::Close()
{
const std::lock_guard<Mutex> protect(mutex);
assert(open);
open = false;
delete timer;
BlockingCall(GetEventLoop(), [this](){
const std::lock_guard<Mutex> protect(mutex);
open = false;
clients.clear_and_dispose(DeleteDisposer());
});