summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2020-10-03 16:06:34 +0200
committerJacopo Mondi <jacopo@jmondi.org>2020-10-07 16:09:22 +0200
commit6c4999e6a41dc11f0c3a0289c050c0d6b6174292 (patch)
tree2c3a040bf51d5d79b589c931c49537500d512e5d /src
parent35f726d4da357a95b6339d77ea43f39c1d6e56c2 (diff)
android: camera_device: Clear streams_ at stop time
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@uajain.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src')
-rw-r--r--src/android/camera_device.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index c6b6fe4b..0a94c1ae 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();