diff --git a/src/output/plugins/httpd/HttpdOutputPlugin.cxx b/src/output/plugins/httpd/HttpdOutputPlugin.cxx index 3ac895fcc..35cd0a8dd 100644 --- a/src/output/plugins/httpd/HttpdOutputPlugin.cxx +++ b/src/output/plugins/httpd/HttpdOutputPlugin.cxx @@ -341,10 +341,12 @@ HttpdOutput::BroadcastFromEncoder() const std::lock_guard lock(mutex); while (!pages.empty()) cond.wait(mutex); + } - PagePtr page; - while ((page = ReadPage()) != nullptr) - pages.push(page); + PagePtr page; + while ((page = ReadPage()) != nullptr) { + const std::lock_guard lock(mutex); + pages.push(std::move(page)); } DeferredMonitor::Schedule();