summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-08-18 02:17:56 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-08-19 19:07:41 +0300
commit3e4672f159791c6334ee943c67a3273161256bcd (patch)
treec25e12ef7dfd078912aca81202a110c7f9c23d31
parentdadd1fd8feb3f00f04023a8b312699a7e1bab861 (diff)
android: camera_hal_manager: Clean up resources when terminating
The CameraHalManager starts the libcamera CameraManager and creates CameraProxy instances for each camera in the system. Clean up those resources when the CameraHalManager terminates. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
-rw-r--r--src/android/camera_hal_manager.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/android/camera_hal_manager.cpp b/src/android/camera_hal_manager.cpp
index a1ffb371..cf981720 100644
--- a/src/android/camera_hal_manager.cpp
+++ b/src/android/camera_hal_manager.cpp
@@ -90,6 +90,10 @@ void CameraHalManager::run()
/* Now start processing events and messages. */
exec();
+
+ /* Clean up the resources we have allocated. */
+ proxies_.clear();
+ cameraManager_->stop();
}
CameraProxy *CameraHalManager::open(unsigned int id,