From patchwork Fri Oct 23 05:10:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 10205 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 175AFBDB13 for ; Fri, 23 Oct 2020 05:11:14 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 11EBA615DE; Fri, 23 Oct 2020 07:11:13 +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="ZTTQrINX"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1AC336034E for ; Fri, 23 Oct 2020 07:11:12 +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 A54C6BB5 for ; Fri, 23 Oct 2020 07:11:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1603429871; bh=t1YFf0l4hNVtGV68VdUV+Xa6JdZXi3pCNKbji1WktNQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ZTTQrINXVB1PMM7rN8a8yVQvk+xH4/NgSu5kUe2+ij3A8Y55DvyZD4I3LJRuBnVW3 WrikQZMdkoZM0YQ0ZB9KrCbPPOTsU0DBQy/pbOAiq2rpIVVBu6FL7Ckii5oj+AbVgh UY4EBziUGd/BrEysFtZqYjfBO5yd+DGDkMWhSOeQ= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Fri, 23 Oct 2020 08:10:19 +0300 Message-Id: <20201023051021.16389-2-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201023051021.16389-1-laurent.pinchart@ideasonboard.com> References: <20201023051021.16389-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 1/3] libcamera: media_object: Remove unneeded destructors 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" The MediaEntity, MediaLink and MediaPad classes don't need custom destructors. For MediaEntity and MediaPad, the destructors clear a vector embedded in the classes, which will be done by the default destructor. For MediaLink, the destructor is already empty. Remove them. Signed-off-by: Laurent Pinchart Reviewed-by: Umang Jain Reviewed-by: Kieran Bingham Reviewed-by: Jacopo Mondi --- include/libcamera/internal/media_object.h | 3 --- src/libcamera/media_object.cpp | 18 ------------------ 2 files changed, 21 deletions(-) diff --git a/include/libcamera/internal/media_object.h b/include/libcamera/internal/media_object.h index be6fb8961349..54311c14895b 100644 --- a/include/libcamera/internal/media_object.h +++ b/include/libcamera/internal/media_object.h @@ -51,7 +51,6 @@ private: MediaLink(const struct media_v2_link *link, MediaPad *source, MediaPad *sink); MediaLink(const MediaLink &) = delete; - ~MediaLink() {} MediaPad *source_; MediaPad *sink_; @@ -73,7 +72,6 @@ private: MediaPad(const struct media_v2_pad *pad, MediaEntity *entity); MediaPad(const MediaPad &) = delete; - ~MediaPad(); unsigned int index_; MediaEntity *entity_; @@ -105,7 +103,6 @@ private: MediaEntity(MediaDevice *dev, const struct media_v2_entity *entity, unsigned int major = 0, unsigned int minor = 0); MediaEntity(const MediaEntity &) = delete; - ~MediaEntity(); void addPad(MediaPad *pad); diff --git a/src/libcamera/media_object.cpp b/src/libcamera/media_object.cpp index b7bf048c985d..056036635902 100644 --- a/src/libcamera/media_object.cpp +++ b/src/libcamera/media_object.cpp @@ -191,15 +191,6 @@ MediaPad::MediaPad(const struct media_v2_pad *pad, MediaEntity *entity) { } -MediaPad::~MediaPad() -{ - /* - * Don't delete the links as we only borrow the reference owned by - * MediaDevice. - */ - links_.clear(); -} - /** * \fn MediaPad::index() * \brief Retrieve the pad index @@ -371,15 +362,6 @@ MediaEntity::MediaEntity(MediaDevice *dev, { } -MediaEntity::~MediaEntity() -{ - /* - * Don't delete the pads as we only borrow the reference owned by - * MediaDevice. - */ - pads_.clear(); -} - /** * \brief Add \a pad to the entity's list of pads * \param[in] pad The pad to add to the list