From patchwork Sat Oct 8 11:15:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Rauch X-Patchwork-Id: 17560 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 4472FBD16B for ; Sat, 8 Oct 2022 11:15:04 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8252E62D48; Sat, 8 Oct 2022 13:15:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1665227703; bh=agyeuMjyoa+Rpn/yw+NcCBKbE6uAEy2tNMo/2rwQqFU=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=xTkUs4u9E6few9Bi3Jm3rAEFbNk3Y9f2q/FxQyxGXcEa40rZtCVwpyYH8SVRsu804 udkiYc9bw1t3l2d7tRk1UnDLvyCzNl221kH2c0ubUXC+ZHX6JbdFiMugAePJCxyZBc DhLk9NJg8bW6NBkSN5VAesTw13Zj3JiaBnova+8t45ZbVF7TILbFAM3eYzu8rXMLs8 NMed02K6vkbR0sZFSXg0yMCBUShlCgwLRIGLaeErOi2tLKZBbo/0meQ98DPFIPzMnU OZ/Jy04Pgm5jvLQUpnn6KF1UqQCQJol4MBSr2xc9bbkNuGaO2bFj6Bf83twSA8nMX8 oqB01DgJgZOEg== Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 843A760A83 for ; Sat, 8 Oct 2022 13:15:02 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=gmx.net header.i=@gmx.net header.b="SMWcvaeM"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1665227702; bh=agyeuMjyoa+Rpn/yw+NcCBKbE6uAEy2tNMo/2rwQqFU=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=SMWcvaeMqW5Mc/+kZ80UXEznMvmfuAFE0RLXEnytLP6OodGWf1eYKUZGQFwmL5nBC WaUcKBqMzkFunZA1GaZiUZXAal3BH79nOaZ3epMAPhxxqLSriEMQAQcdDP2CW0MteD WuzIrqdnas3AyLDZWMfb3N8zs9xRo29lwDY/Oh3I= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from voyager ([88.152.184.103]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MMGN2-1oR6qO0JjK-00JNjt; Sat, 08 Oct 2022 13:15:02 +0200 To: libcamera-devel@lists.libcamera.org Date: Sat, 8 Oct 2022 13:15:00 +0200 Message-Id: <20221008111500.40661-1-Rauch.Christian@gmx.de> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Provags-ID: V03:K1:EfsC1huuSzj+YfgftT2jRITD+Yr9kR/8+U3kLrag+GpPi9NzUKL cI0UQdrDC5MgbLb33QW6PAvRm2WEvm9U0sfR7upGPi625WzpSqSIGU5/lRn5XVzEvoaztul C1uazEg6047nQ8lDzTXYlajJ6kwB1UdZsnyMc13xSqGslWyQGkkv7sdP5Gdb30RsQJ900hI JsClEkFPV0U3IQpwexxNA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:FFanUgNsarE=:+DKPgOvjGNmbPGQSg6C3lb 96FRLYLjSX1TbjQayJAkTcE3zUhdwxHztbYaKrFZ9KU8yZO7b1ax9z5dc+G+J5qK9pRJYlfiN TkreoIAtcypSWniiRJ0VxNBmn+1Wf9NHzODFvCQ/vo16TGYk4oMCZrwFegGNzMTRNgOpEIuXm rWMuzSXXk7Rb7wCmB+/Oe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xws0 McsVRP42q5Oe9wXwcxShKJ5wcmVDE0uAIh6FbcXgYpt8cZM3lTiw0uo/QODnAa9pAKJlf5uoo /3tpzKsx0yW++rHYfr4DtzTxkWYtzys0ft/3F+8GZ3jz3T0mIhRTIPuM4v4I8Di7OMMEIIBcG QD5UCQ5uO3w2f6Ze8CK8AYgPMbUdefYo+73rDqQjWpgAZLZ0XCooB0Opc5cwQlWhknkL7acHZ SMFWOxF4e0+sHmASgCNKC50WD8LcRVeH/goQT2SyhvqVz4rrfUOcwjeVkx9UxoVr5urrij52h YBEaKGfJABeW3EN13CAnXK8sgrn4Yvwi/lEsOod2M3MWG Subject: [libcamera-devel] [PATCH] libcamera: Release all devices on shutdown 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: , X-Patchwork-Original-From: Christian Rauch via libcamera-devel From: Christian Rauch Reply-To: Christian Rauch Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Some devices may not be released via their 'PipelineHandler'. This results in these devices still being acquired or busy on shutdown. Make sure that all devices are released when DeviceEnumerator is deconstructed. Signed-off-by: Christian Rauch --- src/libcamera/device_enumerator.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) -- 2.34.1 diff --git a/src/libcamera/device_enumerator.cpp b/src/libcamera/device_enumerator.cpp index f2e055de..d0968a0a 100644 --- a/src/libcamera/device_enumerator.cpp +++ b/src/libcamera/device_enumerator.cpp @@ -161,12 +161,8 @@ std::unique_ptr DeviceEnumerator::create() DeviceEnumerator::~DeviceEnumerator() { - for (const std::shared_ptr &media : devices_) { - if (media->busy()) - LOG(DeviceEnumerator, Error) - << "Removing media device " << media->deviceNode() - << " while still in use"; - } + for (const std::shared_ptr &media : devices_) + media->release(); } /**