[{"id":33277,"web_url":"https://patchwork.libcamera.org/comment/33277/","msgid":"<3uk2ol6ilu5sktfh3cunmcyr43hn52gpnqpr56fxzhpq2svgnt@gudwlnv7u4o4>","date":"2025-02-03T19:14:59","subject":"Re: [RFC PATCH v3 02/21] apps: common: event_loop: Disable copy/move","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Barnabás\n\nOn Thu, Jan 30, 2025 at 11:50:13AM +0000, Barnabás Pőcze wrote:\n> The compiler generated functions are not appropriate, so\n> delete the copy/move constructor/assignment to avoid\n> potential issues.\n>\n> Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>\n\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\nThanks\n  j\n\n> ---\n>  src/apps/common/event_loop.h | 5 +++++\n>  1 file changed, 5 insertions(+)\n>\n> diff --git a/src/apps/common/event_loop.h b/src/apps/common/event_loop.h\n> index d7d012c76..4e8dd0a46 100644\n> --- a/src/apps/common/event_loop.h\n> +++ b/src/apps/common/event_loop.h\n> @@ -13,6 +13,8 @@\n>  #include <memory>\n>  #include <mutex>\n>\n> +#include <libcamera/base/class.h>\n> +\n>  #include <event2/util.h>\n>\n>  struct event_base;\n> @@ -43,8 +45,11 @@ public:\n>  \t\t\t   std::function<void()> &&handler);\n>\n>  private:\n> +\tLIBCAMERA_DISABLE_COPY_AND_MOVE(EventLoop)\n> +\n>  \tstruct Event {\n>  \t\tEvent(std::function<void()> &&callback);\n> +\t\tLIBCAMERA_DISABLE_COPY_AND_MOVE(Event)\n>  \t\t~Event();\n>\n>  \t\tstatic void dispatch(int fd, short events, void *arg);\n> --\n> 2.48.1\n>\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 95768C3260\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  3 Feb 2025 19:15:05 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 55159685A8;\n\tMon,  3 Feb 2025 20:15:05 +0100 (CET)","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 77AF56859D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  3 Feb 2025 20:15:03 +0100 (CET)","from ideasonboard.com (93-61-96-190.ip145.fastwebnet.it\n\t[93.61.96.190])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 00391514;\n\tMon,  3 Feb 2025 20:13:51 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"AHo0jI96\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1738610032;\n\tbh=O8uRo2KoECz/EHsUmoMvpZferIXUvCDmxKirO9wOss4=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=AHo0jI963/5/X8ZaQHqo4MqRF0OkUL8EJb/nA8TTWGk9bbK3VqrGJDP46Pjl3O3JD\n\tYbao5JNksrE1xPRc1WT2K7cUCae/7vzCZ0UpBYQ+BC+9c5x4PtRX61zj0scBIWBMsA\n\tOVoPtdcE5L1cDjPVKxrf8TQAQhbJ39McYv9UXJXI=","Date":"Mon, 3 Feb 2025 20:14:59 +0100","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <pobrn@protonmail.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [RFC PATCH v3 02/21] apps: common: event_loop: Disable copy/move","Message-ID":"<3uk2ol6ilu5sktfh3cunmcyr43hn52gpnqpr56fxzhpq2svgnt@gudwlnv7u4o4>","References":"<20250130115001.1129305-1-pobrn@protonmail.com>\n\t<20250130115001.1129305-3-pobrn@protonmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20250130115001.1129305-3-pobrn@protonmail.com>","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]