diff --git a/src/CameraHandler.cpp b/src/CameraHandler.cpp index d083fdf..0dfd485 100644 --- a/src/CameraHandler.cpp +++ b/src/CameraHandler.cpp @@ -456,14 +456,16 @@ void CameraHandler::streamStop(domid_t domId, const xencamera_req& aReq, return; } - std::lock_guard lock(mLock); + std::unique_lock lock(mLock); DLOG(mLog, DEBUG) << "Handle command [STREAM STOP] dom " << std::to_string(domId); mStreamingNow.erase(domId); - if (!mStreamingNow.size()) + if (!mStreamingNow.size()) { + lock.unlock(); mCamera->streamStop(); + } } void CameraHandler::release()