[libcamera-devel] [PATCH v3 13/13] android: camera_device: Clear streams_ at stop time
Jacopo Mondi
jacopo at jmondi.org
Wed Oct 7 12:17:45 CEST 2020
When the CameraDevice is stopped, we need to clear the vector
of CameraStream instances to make sure they get deleted and all the
resources they have acquired get released.
Reviewed-by: Umang Jain <email at uajain.com>
Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
---
src/android/camera_device.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index c6b6fe4b3ae3..0a94c1ae17ac 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -517,6 +517,8 @@ int CameraDevice::open(const hw_module_t *hardwareModule)
void CameraDevice::close()
{
+ streams_.clear();
+
camera_->stop();
camera_->release();
--
2.28.0
More information about the libcamera-devel
mailing list