From patchwork Tue Oct 6 14:44:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 9982 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 3F974BEEDF for ; Tue, 6 Oct 2020 14:40:54 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1C1E663CD7; Tue, 6 Oct 2020 16:40:54 +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 9B8D363C9B for ; Tue, 6 Oct 2020 16:40:52 +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 0C9E960007; Tue, 6 Oct 2020 14:40:51 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Tue, 6 Oct 2020 16:44:32 +0200 Message-Id: <20201006144432.22908-14-jacopo@jmondi.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201006144432.22908-1-jacopo@jmondi.org> References: <20201006144432.22908-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 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: Laurent Pinchart Signed-off-by: Jacopo Mondi Reviewed-by: Kieran Bingham Reviewed-by: Umang Jain --- 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 58a9f44db219..8da70e817b46 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();