summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-01-22 21:25:05 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-01-23 22:36:30 +0200
commita0295fdaf854bb10c387255f10677d9b6f1554dc (patch)
tree85c82ea804c0f373566924435b3c165f7399ea69 /src
parentb6467bd9c67f69fe5023cb524391b8f1fc5c44c4 (diff)
libcamera: camera_manager: Return a copy of the vector from cameras()
Making CameraManager::cameras() thread-safe requires returning a copy of the cameras vector instead of a reference. This is also required for hot-plugging support and is thus desirable. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Diffstat (limited to 'src')
-rw-r--r--src/libcamera/camera_manager.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libcamera/camera_manager.cpp b/src/libcamera/camera_manager.cpp
index e0a07ec5..5fc1bba9 100644
--- a/src/libcamera/camera_manager.cpp
+++ b/src/libcamera/camera_manager.cpp
@@ -244,7 +244,7 @@ void CameraManager::stop()
*
* \return List of all available cameras
*/
-const std::vector<std::shared_ptr<Camera>> &CameraManager::cameras() const
+std::vector<std::shared_ptr<Camera>> CameraManager::cameras() const
{
return p_->cameras_;
}