Message ID | 20211203164619.1541033-5-hiroh@chromium.org |
---|---|
State | New |
Headers | show |
Series |
|
Related | show |
diff --git a/src/libcamera/camera_manager.cpp b/src/libcamera/camera_manager.cpp index 70d73822..4492edc3 100644 --- a/src/libcamera/camera_manager.cpp +++ b/src/libcamera/camera_manager.cpp @@ -178,7 +178,10 @@ void CameraManager::Private::cleanup() * process deletion requests from the thread's message queue as the event * loop is not in action here. */ + mutex_.lock(); cameras_.clear(); + mutex_.unlock(); + dispatchMessages(Message::Type::DeferredDelete); enumerator_.reset(nullptr);
This fixes the bug that camera_ is accessed without acquiring mutex_ in CameraManager::Private::cleanup(). Signed-off-by: Hirokazu Honda <hiroh@chromium.org> --- src/libcamera/camera_manager.cpp | 3 +++ 1 file changed, 3 insertions(+)