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>
This commit is contained in:
Jacopo Mondi 2020-10-03 16:06:34 +02:00
parent 35f726d4da
commit 6c4999e6a4

View file

@ -517,6 +517,8 @@ int CameraDevice::open(const hw_module_t *hardwareModule)
void CameraDevice::close() void CameraDevice::close()
{ {
streams_.clear();
camera_->stop(); camera_->stop();
camera_->release(); camera_->release();