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>
This commit is contained in:
Laurent Pinchart 2020-01-22 21:25:05 +02:00
parent b6467bd9c6
commit a0295fdaf8
2 changed files with 2 additions and 2 deletions

View file

@ -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_;
}