From patchwork Mon Oct 5 10:46:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 9962 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 E8AB2C3B5F for ; Mon, 5 Oct 2020 10:47:44 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id AF4F663C74; Mon, 5 Oct 2020 12:47:44 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="fLAHW+OU"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 80AF163BD5 for ; Mon, 5 Oct 2020 12:47:39 +0200 (CEST) Received: from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 1925859E; Mon, 5 Oct 2020 12:47:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1601894859; bh=9fnEmf+uRGJAlayAfulaFQMZza6rsz9bQhIEF1SdMX4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fLAHW+OUmIMFxM5TpH5t3+B2wnmU2r9Dba+0EYCUoSNKv/LaXMFVDjvuBEheI8CXZ olgu4vDL9ZP+gI+DjbJlDd4b6jfRf3mPokpihkUm4qs9DeIiHW081zQXFoaPmHt+uw hqgC2z9vuy4kaHBaWiPdYLZiQF1l/EAL9ES2PMjo= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Mon, 5 Oct 2020 13:46:49 +0300 Message-Id: <20201005104649.10812-16-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201005104649.10812-1-laurent.pinchart@ideasonboard.com> References: <20201005104649.10812-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 15/15] 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" From: Jacopo Mondi 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. Signed-off-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- 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 1a9af2e34340..6bbdfcc4a28b 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();