From patchwork Wed Oct 7 10:17:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 10005 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 6EC7BBEEDF for ; Wed, 7 Oct 2020 10:14:10 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 48CC860423; Wed, 7 Oct 2020 12:14:10 +0200 (CEST) Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id BC2DA6049A for ; Wed, 7 Oct 2020 12:14:08 +0200 (CEST) X-Originating-IP: 93.34.118.233 Received: from uno.lan (93-34-118-233.ip49.fastwebnet.it [93.34.118.233]) (Authenticated sender: jacopo@jmondi.org) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 19BB260012; Wed, 7 Oct 2020 10:14:06 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Wed, 7 Oct 2020 12:17:45 +0200 Message-Id: <20201007101745.15104-14-jacopo@jmondi.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201007101745.15104-1-jacopo@jmondi.org> References: <20201007101745.15104-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 13/13] android: camera_device: Clear streams_ at stop time X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" 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 Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart Signed-off-by: Jacopo Mondi --- 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();