From patchwork Sat Dec 12 18:51:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 10657 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 D7E70BD80A for ; Sat, 12 Dec 2020 18:51:30 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 023F0605BF; Sat, 12 Dec 2020 19:51:30 +0100 (CET) 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="rbyeojfr"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id DA0916032B for ; Sat, 12 Dec 2020 19:51:26 +0100 (CET) Received: from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 4CCD396 for ; Sat, 12 Dec 2020 19:51:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1607799086; bh=L0G4387GGHyzIwKCbIEGE3XhEEMgZCN846owPFd4fSc=; h=From:To:Subject:Date:From; b=rbyeojfrkClUW2N5xylkSTTdy/Yv9diIUwwQ+mj32m3uzh9mJHsxNflvro38bPR1O +MtB00Lp0inBM0RKKuSnJwIlVkNAkD6IQhnYQ90L3Do8Lyt/MjGzn+q2hGI5+CFkuc /bBVIx9iI2NgGvg6R2IERJPXKEpkfYLjcTL5Y3sc= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Sat, 12 Dec 2020 20:51:13 +0200 Message-Id: <20201212185116.29611-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 0/3] libcamera: Fix leaks and simplify object management with std::unique_ptr<> 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" Hello, This small patch series is a follow-up of the switch of V4L2*::fromEntityName() to std::unique_ptr<>. It replaces more manually managed pointers with std::unique_ptr<> in pipeline handlers, including expanding usage of V4L2*::fromEntityName(). I've noticed a memory leak while writing the code, which is fixed in patch 1/3. Laurent Pinchart (3): libcamera: pipeline: raspberrypi: Don't leak RPiCameraData::sensor_ libcamera: pipeline: vimc: Use V4L2*::fromEntityName() where possible libcamera: pipeline: Manage resources with std::unique_ptr<> src/libcamera/pipeline/ipu3/cio2.cpp | 11 ++----- src/libcamera/pipeline/ipu3/cio2.h | 9 +++-- .../pipeline/raspberrypi/raspberrypi.cpp | 7 ++-- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 19 ++++------- src/libcamera/pipeline/simple/converter.cpp | 8 +---- src/libcamera/pipeline/simple/converter.h | 3 +- src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 12 +++---- src/libcamera/pipeline/vimc/vimc.cpp | 33 +++++++------------ 8 files changed, 34 insertions(+), 68 deletions(-)