{"id":1056,"url":"https://patchwork.libcamera.org/api/1.1/patches/1056/?format=json","web_url":"https://patchwork.libcamera.org/patch/1056/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20190418141437.14014-10-laurent.pinchart@ideasonboard.com>","date":"2019-04-18T14:14:33","name":"[libcamera-devel,v3,09/13] libcamera: v4l2_subdevice: Close subdevice when destroyed","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"06ee80843c00ae32cf3a9a746cd3811756b0484b","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/1.1/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/1056/mbox/","series":[{"id":256,"url":"https://patchwork.libcamera.org/api/1.1/series/256/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=256","date":"2019-04-18T14:14:24","name":"Rockchip ISP pipeline handler","version":3,"mbox":"https://patchwork.libcamera.org/series/256/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/1056/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/1056/checks/","tags":{},"headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 30E5C60DDC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 18 Apr 2019 16:14:58 +0200 (CEST)","from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id AFD2B9A7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 18 Apr 2019 16:14:57 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1555596897;\n\tbh=/HOFiTfjXrNuaK6WbexcRsw61u3GR7weSKjD8dBPiYY=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=Q35yhMVXa0IyvyMoLlkJ2hTd1Cwff2b1cqa+o7FQTb1vNDnwUrbGZyaoP/shzNSiY\n\twW9IQ5SU+Bf6qCHug0PzDEubB49R67NErGUnI1ZpGfh0Qrien7j0adEwxNsOWd3cpH\n\tW+7ukla3x46Y47r3GyroxlwvF75JP802MwVICb0M=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Thu, 18 Apr 2019 17:14:33 +0300","Message-Id":"<20190418141437.14014-10-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.21.0","In-Reply-To":"<20190418141437.14014-1-laurent.pinchart@ideasonboard.com>","References":"<20190418141437.14014-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v3 09/13] libcamera: v4l2_subdevice: Close\n\tsubdevice when destroyed","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Thu, 18 Apr 2019 14:15:00 -0000"},"content":"Make sure the subdevice file descriptor isn't leaked by closing it when\nthe V4L2Subdevice instance is destroyed.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/libcamera/include/v4l2_subdevice.h | 1 +\n src/libcamera/v4l2_subdevice.cpp       | 5 +++++\n 2 files changed, 6 insertions(+)","diff":"diff --git a/src/libcamera/include/v4l2_subdevice.h b/src/libcamera/include/v4l2_subdevice.h\nindex c71dce7d8644..e592d67dd043 100644\n--- a/src/libcamera/include/v4l2_subdevice.h\n+++ b/src/libcamera/include/v4l2_subdevice.h\n@@ -35,6 +35,7 @@ public:\n \texplicit V4L2Subdevice(const MediaEntity *entity);\n \tV4L2Subdevice(const V4L2Subdevice &) = delete;\n \tV4L2Subdevice &operator=(const V4L2Subdevice &) = delete;\n+\t~V4L2Subdevice();\n \n \tint open();\n \tbool isOpen() const;\ndiff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp\nindex e34cc1693b46..a03fadfd579e 100644\n--- a/src/libcamera/v4l2_subdevice.cpp\n+++ b/src/libcamera/v4l2_subdevice.cpp\n@@ -112,6 +112,11 @@ V4L2Subdevice::V4L2Subdevice(const MediaEntity *entity)\n {\n }\n \n+V4L2Subdevice::~V4L2Subdevice()\n+{\n+\tclose();\n+}\n+\n /**\n  * \\brief Open a V4L2 subdevice\n  *\n","prefixes":["libcamera-devel","v3","09/13"]}