[libcamera-devel] [PATCH v2 3/8] android: CameraHalManager: Fix a function call of a moved Camera
Hirokazu Honda
hiroh at chromium.org
Wed Mar 24 08:07:52 CET 2021
libcamera::Camera::id() is called after std::move() in
cameraAdded(). This fixes the issue by not executing std::move().
Signed-off-by: Hirokazu Honda <hiroh at chromium.org>
---
src/android/camera_hal_manager.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/android/camera_hal_manager.cpp b/src/android/camera_hal_manager.cpp
index b501f8db..f70cd8a8 100644
--- a/src/android/camera_hal_manager.cpp
+++ b/src/android/camera_hal_manager.cpp
@@ -115,7 +115,7 @@ void CameraHalManager::cameraAdded(std::shared_ptr<Camera> cam)
}
/* Create a CameraDevice instance to wrap the libcamera Camera. */
- std::unique_ptr<CameraDevice> camera = CameraDevice::create(id, std::move(cam));
+ std::unique_ptr<CameraDevice> camera = CameraDevice::create(id, cam);
int ret = camera->initialize();
if (ret) {
LOG(HAL, Error) << "Failed to initialize camera: " << cam->id();
--
2.31.0.291.g576ba9dcdaf-goog
More information about the libcamera-devel
mailing list