[{"id":25295,"web_url":"https://patchwork.libcamera.org/comment/25295/","msgid":"<89c165a7-dc5e-cbf5-e955-b06b73ecd6d6@oss.nxp.com>","date":"2022-10-05T10:59:32","subject":"Re: [libcamera-devel] [PATCH 3/8] ipa: camera_sensor_helper: Return\n\tunique_ptr from createInstance","submitter":{"id":107,"url":"https://patchwork.libcamera.org/api/people/107/","name":"Xavier Roumegue","email":"xavier.roumegue@oss.nxp.com"},"content":"Hi Laurent,\n\nThanks for the patch.\n\nOn 10/3/22 23:21, Laurent Pinchart via libcamera-devel wrote:\n> Avoid naked pointer with memory allocation by returning a unique_ptr\n> from CameraSensorHelperFactory::createInstance(), in order to increase\n> memory allocation safety.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>   src/ipa/libipa/camera_sensor_helper.cpp | 7 +++----\n>   src/ipa/libipa/camera_sensor_helper.h   | 6 +++---\n>   2 files changed, 6 insertions(+), 7 deletions(-)\n> \n> diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp\n> index fde9bf5b8892..3a7d701d8616 100644\n> --- a/src/ipa/libipa/camera_sensor_helper.cpp\n> +++ b/src/ipa/libipa/camera_sensor_helper.cpp\n> @@ -261,8 +261,7 @@ std::unique_ptr<CameraSensorHelper> CameraSensorHelperFactory::create(const std:\n>   \t\tif (name != factory->name_)\n>   \t\t\tcontinue;\n>   \n> -\t\tCameraSensorHelper *helper = factory->createInstance();\n> -\t\treturn std::unique_ptr<CameraSensorHelper>(helper);\n> +\t\treturn factory->createInstance();\n>   \t}\n>   \n>   \treturn nullptr;\n> @@ -307,8 +306,8 @@ std::vector<CameraSensorHelperFactory *> &CameraSensorHelperFactory::factories()\n>    * macro. It creates a camera sensor helper instance associated with the camera\n>    * sensor model.\n>    *\n> - * \\return A pointer to a newly constructed instance of the CameraSensorHelper\n> - * subclass corresponding to the factory\n> + * \\return A unique pointer to a newly constructed instance of the\n> + * CameraSensorHelper subclass corresponding to the factory\n>    */\n>   \n>   /**\n> diff --git a/src/ipa/libipa/camera_sensor_helper.h b/src/ipa/libipa/camera_sensor_helper.h\n> index 410156efb2ea..21ee43cc9f9f 100644\n> --- a/src/ipa/libipa/camera_sensor_helper.h\n> +++ b/src/ipa/libipa/camera_sensor_helper.h\n> @@ -73,7 +73,7 @@ private:\n>   \n>   \tstatic void registerType(CameraSensorHelperFactory *factory);\n>   \n> -\tvirtual CameraSensorHelper *createInstance() const = 0;\n> +\tvirtual std::unique_ptr<CameraSensorHelper> createInstance() const = 0;\n>   \n>   \tstd::string name_;\n>   };\n> @@ -85,9 +85,9 @@ public: \t\t\t\t\t\t\t\\\n>   \thelper##Factory() : CameraSensorHelperFactory(name) {}\t\\\n>   \t\t\t\t\t\t\t\t\\\n>   private:\t\t\t\t\t\t\t\\\n> -\tCameraSensorHelper *createInstance() const\t\t\\\n> +\tstd::unique_ptr<CameraSensorHelper> createInstance() const \\\n>   \t{\t\t\t\t\t\t\t\\\n> -\t\treturn new helper();\t\t\t\t\\\n> +\t\treturn std::make_unique<helper>();\t\t\\\n>   \t}\t\t\t\t\t\t\t\\\n>   };\t\t\t\t\t\t\t\t\\\n>   static helper##Factory global_##helper##Factory;\n\n\nReviewed-by: Xavier Roumegue <xavier.roumegue@oss.nxp.com>","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 47011C0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  5 Oct 2022 10:59:37 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id EF5F5622E6;\n\tWed,  5 Oct 2022 12:59:36 +0200 (CEST)","from EUR04-VI1-obe.outbound.protection.outlook.com\n\t(mail-eopbgr80059.outbound.protection.outlook.com [40.107.8.59])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 612C7621BC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  5 Oct 2022 12:59:36 +0200 (CEST)","from PAXPR04MB8703.eurprd04.prod.outlook.com\n\t(2603:10a6:102:21e::22)\n\tby PAXPR04MB9447.eurprd04.prod.outlook.com (2603:10a6:102:2b2::11)\n\twith Microsoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.28;\n\tWed, 5 Oct 2022 10:59:34 +0000","from PAXPR04MB8703.eurprd04.prod.outlook.com\n\t([fe80::4f72:a35a:8c60:63f1]) by\n\tPAXPR04MB8703.eurprd04.prod.outlook.com\n\t([fe80::4f72:a35a:8c60:63f1%6]) with mapi id 15.20.5676.028;\n\tWed, 5 Oct 2022 10:59:34 +0000"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1664967577;\n\tbh=Vz51xSGwqQIi9m7e+23hOnQ+zetUmGZbdSnc2xj9+b4=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=Y7ylQElkT2/DOfZxbBs0g9XvXFrdZZHWAMDdLdmEfFePMetQ5y7adY1h1pFb/Xew+\n\tSrSUTeAOaKyV3AlZObB/R9JDmaQg9+Xm4wslGBleVC1RRZpzVWbvwVGtwLcC6pQSUC\n\tdFUXckH5FRRiZQjRSselCOO8NYV8xxrCk5brBj2eN/Fe5r3JovbC6LcKYdBEXJB1PN\n\txYWbS2AOmiq0KwUmNsOiyfDiqPgKy6arq5Rz//oSUNTJogWU7yR6DJQNoxOCjYbnoT\n\tn3zIl514KsrBA6EuWq6VPnzii50+MNSitKloYbwEg+zhwtgVelhBgZbhBd26q3QM7H\n\thGGecCIBoh9Iw==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com;\n\ts=selector2-NXP1-onmicrosoft-com;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n\tbh=dkx9ymt0+fvCJSy38HJD0KK3qruWz5VEomId0UzFumY=;\n\tb=Updj1Ann3UITZL19EFzfJ4oOuJkSbU3oaz1ZeekkUz17OkKZxtSug+Y+uvR7e4CIb1SYU+GSx6sKO6JbeWKsJCoer+1UGdUZjAmI5Qh18vXdZ3Vxub+GENWnpgMZPjt2JuJOKXar5+q0KMELbH3SQdpsfWLkMMDNDftL2nlV7dA="],"Authentication-Results":["lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=NXP1.onmicrosoft.com\n\theader.i=@NXP1.onmicrosoft.com\n\theader.b=\"Updj1Ann\"; dkim-atps=neutral","dkim=none (message not signed)\n\theader.d=none;dmarc=none action=none header.from=oss.nxp.com;"],"ARC-Seal":"i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n\tb=fV7Cp6dP+lbbLW0H2twUKyCaO+8rOB0cjxn5fjVNh+2fCnn4hdqPjY1NZ7AffRk4mqZk+Ns5y5nTUK5tDN36zVtHKYSoj33/aNInIMXxaQUbhHBT81NjIatGR8P9vnv2UFV7FTgb8wDFo5EuzHNOBGiAwo2BZQU2AmN9m7emBQhkBNyukMu0Gs91pMd5ha2vKdJfWvsGtDT5x6d/h+0EZ4cqTdDKRb0eeY1sywn+NS8V4ljsEGmmArPXjSSPLiPoHIIABYNqAex/beYdgvfYYRULFA4fOYTha5hAMZAu3VrozocaiRvovE7gYbduYKFnxERC32SPi9kAkclAm/7ATA==","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n\ts=arcselector9901;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;\n\tbh=dkx9ymt0+fvCJSy38HJD0KK3qruWz5VEomId0UzFumY=;\n\tb=PS6y2Jd9pgG28Y7OcRtyFLIjRYyNDLWoBDBil7oaW3jOYMDKGpn+Nw49Kg4pNXcMEM40u6cdPVRA8H47PL9Szdz1zklwLRt9D2NrOsuWNAkc2OKV3kzNVJIP+3aIRe5okiAhYczTFnSyE5/Eq4aOhVECyJnDVqRSuAOVwB6+HoCDJvDOCqViObmliZIyhmQTWdfnzoOMdTy6NwSAjCxCVE63JCxZdlk2wfXVYlTgLu1xs7Y/lGWr4dhPNlpE1l3MyicFlH8b2LHu3byrBJfjJXkGdKnMHpHG6fdBY5GfOFS4nJyIr1woTjASw4FIib5fdxfVogOTShmnnrsKbyQyMw==","ARC-Authentication-Results":"i=1; mx.microsoft.com 1; spf=pass\n\tsmtp.mailfrom=oss.nxp.com;\n\tdmarc=pass action=none header.from=oss.nxp.com; \n\tdkim=pass header.d=oss.nxp.com; arc=none","Message-ID":"<89c165a7-dc5e-cbf5-e955-b06b73ecd6d6@oss.nxp.com>","Date":"Wed, 5 Oct 2022 12:59:32 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101\n\tThunderbird/102.3.1","Content-Language":"en-US, fr","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20221003212128.32429-1-laurent.pinchart@ideasonboard.com>\n\t<20221003212128.32429-4-laurent.pinchart@ideasonboard.com>","In-Reply-To":"<20221003212128.32429-4-laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","X-ClientProxiedBy":"PA7P264CA0120.FRAP264.PROD.OUTLOOK.COM\n\t(2603:10a6:102:34c::18) To PAXPR04MB8703.eurprd04.prod.outlook.com\n\t(2603:10a6:102:21e::22)","MIME-Version":"1.0","X-MS-Exchange-MessageSentRepresentingType":"1","X-MS-PublicTrafficType":"Email","X-MS-TrafficTypeDiagnostic":"PAXPR04MB8703:EE_|PAXPR04MB9447:EE_","X-MS-Office365-Filtering-Correlation-Id":"1acb8fd9-b6f9-4837-ba92-08daa6c0afbd","X-MS-Exchange-SharedMailbox-RoutingAgent-Processed":"True","X-MS-Exchange-SenderADCheck":"1","X-MS-Exchange-AntiSpam-Relay":"0","X-Microsoft-Antispam":"BCL:0;","X-Microsoft-Antispam-Message-Info":"8P9ujWDrmdK7DZByEAyPn5efsRfQE4I33w/YzX0oDYXsK4h1tKFHO8XjbmQ5z0JaoKgalygihY+p1ce/THXrUfzALA+Amb2TmGQJKxFraQ/bLls57DXSo6x5na4bHLhyS2K9VBalc3HN6XmBU/My6jVq2vXN2sWgAaCVl4SMt9EtG1g4zQiXN4H8QLdJcCUfPbWo49KQPGyL5kSR+ow+55g2FGIZApOjWB/2FlIyJK9nrGqkJ9a936DgFUn1/Daj9QISL1PKjfA9J1vWyDeYv6IOXACIwOFV3VKYsQ931/lZdgb1WPw/wT0cffDHnRL3qpCFGzuhw91xBVAyivIiEXu6o2mp+in4rMRz35COG4B4a+FGJ1RX3UdzC3J5dT/KkqQgQ/oeectGdy/Fzxb1Xrt/Y6AQ/M2d8K7y4VgCM3tZOhJE6PyYQVsPKgxruSeX3ofewHwNLZf//S+t7WgmAmzBtOd5LLqOHMoEKVBH4YiPtNTAIuwr4il2GmRt4RTax1RbBBTp2EIxO6XY43ZKDyyPv+nVMC5we4WvrRis6cA1YQV7MTXajdq5nuf0rVDHQbsu3pDiQPLMB6tgI9e9YaQcFH5v/p4JHsUjMDwt5H/uYwpr4r4apIjqwQ7F8IZ8OeONeS1WxpddDoyl6cpEczc9v7EA33GJ9DXr9QNE1s4y74joaAb3JLcYbSeEBLnyA8Za7e0cgqTno4EzBMjVAOYw826xi1U+4klF6psEPe1mNXMVhjTXtR6UCy1JawXAB09UzEZBLiS8D1/TxKalErIiIm3zoXe3HgASbCwe/iE=","X-Forefront-Antispam-Report":"CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;\n\tIPV:NLI; SFV:NSPM; H:PAXPR04MB8703.eurprd04.prod.outlook.com; PTR:;\n\tCAT:NONE; \n\tSFS:(13230022)(4636009)(376002)(366004)(346002)(39860400002)(136003)(396003)(451199015)(31686004)(41300700001)(2906002)(5660300002)(8936002)(478600001)(66556008)(38100700002)(86362001)(31696002)(66476007)(2616005)(53546011)(52116002)(8676002)(66946007)(316002)(6512007)(6506007)(6486002)(186003)(83380400001)(45980500001)(43740500002);\n\tDIR:OUT; SFP:1101; ","X-MS-Exchange-AntiSpam-MessageData-ChunkCount":"1","X-MS-Exchange-AntiSpam-MessageData-0":"=?utf-8?q?LowfgLv8pGyusKto/tmYtpZwk?=\n\t=?utf-8?q?B6Rdwo4OVLgMVbK7IbbwSQDm8UmnigNlPGAWuzo6KQSb0blOQK38gcf2?=\n\t=?utf-8?q?OtLN5TWmU2UY2E0UO47iXIM7khqTjDRUPuVt6dLzfgBbByUp7Tr7GN/4?=\n\t=?utf-8?q?eKAfhsxzV85XW4Za58hqFkJ2+khAAfdM1bHvZvmvSNCgMhTM/dYIk/4t?=\n\t=?utf-8?q?KOEyaaOy9k5xXSNvPN2gJJba11XX86OGuDLsiUUoCt2XBoF5FgYYhbo2?=\n\t=?utf-8?q?hhsoaZsYvwKGtOKkSZ1KGxzOzHK8qX6PeJ2Bqp+jbefnibQUJR/TOZJ6?=\n\t=?utf-8?q?Sqo2N35CMB5HP1EqZ49IsU3mAmRVx8czvYNsjUgIl0q8WUQmyx6ALlZX?=\n\t=?utf-8?q?Ls/g1QazjoEmhyXDD/3H3Uea5mdbcS2L38Pv9Ecd7RWmOSF3wZwNXTVU?=\n\t=?utf-8?q?hL5gEnOvNG8amabfEmdgmK2g4/JU/xsSYkcSCQXsIMQ+QP4gFgTEk9OL?=\n\t=?utf-8?q?t7hRv6ocYRTvvKqc08YkJmq95hgzzUT20dzajQu2+c6yaZ6zxShoSfbM?=\n\t=?utf-8?q?iGzDpp2owNhN2Fu7Le+xxi4j7gegzVM8uXvNSqn9IO5VHo/5pGhqUYqW?=\n\t=?utf-8?q?VaXswZReWkYEVhBkttPHgJyIQ32TFggwm/gksSGoA7u9B2nt4OvXOc3w?=\n\t=?utf-8?q?6G0ohS9CamKjey0Dz8fJIagGfFzsLX6B6ibFfVcTDxPDR9E2EH/0PJkR?=\n\t=?utf-8?q?S1uXh8ziXpqLSLsOhbZqRKCDgjfKWKhSFDzYssMZJSYODxDsgyUW8WKc?=\n\t=?utf-8?q?433ygW/bypFksdhkp81J/mnx4Uz3Xuemqk1vDtJMkDr9xSQE7ZrMnLMl?=\n\t=?utf-8?q?nFN1hmv3mgPfpJckvfLPsm6G8wTkrJ5vavAmb1KO5zQJ5G6wik2SWMNI?=\n\t=?utf-8?q?LfkxIm4sXai8wijs1p4LbFTS7vSljlTDH/t2stxBAhOH50gqbvPy8OJ6?=\n\t=?utf-8?q?p83wNUE92ggjYkjTqvt4z84yXyJXX2UvkU2AEQS8bGWsx7MPEiu2yvnQ?=\n\t=?utf-8?q?z5s65ErP/wAKPi/fG9uCVuAwZS79KUIuIcfzsEy16JNTvWJpR6nMkEVb?=\n\t=?utf-8?q?Zf+kf/RPUYsyPt4dop3YQ2iV++LKEB+s/MJysd4n+CUUZQRZZ8hTq7a2?=\n\t=?utf-8?q?5ktEEV4vKsqdBN/nyLfFfjtsH1uLumKNvOfamawO5F56tSDMOr6GMTc4?=\n\t=?utf-8?q?05qHcZGzkJGAI3BqmL6b9Red6A2NkW+eUcqLQQfhLFeEoLQ6jkVtCypN?=\n\t=?utf-8?q?cDTR4Otr2dxBPqzSRRj1GDi3vnGljCq+KY1x6iFTATBg9s5MKgyGObKp?=\n\t=?utf-8?q?AqlHFOy+pL/aHHvl0XWttXc0w+oL+P3efUMCpVNjLP+mxw3sXYrgtnvS?=\n\t=?utf-8?q?cNIX8GDKqI4vEKr/tiZUT/jsQY+2wMh81hiPeAC7GzdJAjyfSRXavT1Q?=\n\t=?utf-8?q?Un5B8lsGer0cF8PhokN0oW/NMTXTCyN/fRq0WUbI5UVrE2BcWZYevWaD?=\n\t=?utf-8?q?9eM/ID9TAkFVF+pQbzKHhugidfBplPdKwGnrz7J8fRQ4u4nZBEPjabc4?=\n\t=?utf-8?q?H27Ow66l9nMLqx3pxofhRH806jGjQ54p77S083utl048PhBoP9ODTeFE?=\n\t=?utf-8?q?yUT+sFfCkcVUtrdZV/Nb/2h4NUtmz1/y4Tw34SdPNGKT55Zbh86bebz0?=\n\t=?utf-8?q?1ROoi31keeM+B9A/zBfyRJM3mVAfUARZzgQiHcspKq/8fKuWXw5ycO6P?=\n\t=?utf-8?q?vSWL5Ju3Lyfyh4qT9xSUxldsYbzFyZDQJeigw=3D=3D?=","X-OriginatorOrg":"oss.nxp.com","X-MS-Exchange-CrossTenant-Network-Message-Id":"1acb8fd9-b6f9-4837-ba92-08daa6c0afbd","X-MS-Exchange-CrossTenant-AuthSource":"PAXPR04MB8703.eurprd04.prod.outlook.com","X-MS-Exchange-CrossTenant-AuthAs":"Internal","X-MS-Exchange-CrossTenant-OriginalArrivalTime":"05 Oct 2022 10:59:34.0599\n\t(UTC)","X-MS-Exchange-CrossTenant-FromEntityHeader":"Hosted","X-MS-Exchange-CrossTenant-Id":"686ea1d3-bc2b-4c6f-a92c-d99c5c301635","X-MS-Exchange-CrossTenant-MailboxType":"HOSTED","X-MS-Exchange-CrossTenant-UserPrincipalName":"0OGVSRYoJNrlPYaoym8yFl+CU/Fsw7vQuoX5RwdAMaWwTO+CE8jl1JZUhOm6iovcxaAP0tcBT3iv9HwgLM5dBQ==","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"PAXPR04MB9447","Subject":"Re: [libcamera-devel] [PATCH 3/8] ipa: camera_sensor_helper: Return\n\tunique_ptr from createInstance","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>","From":"\"Xavier Roumegue \\(OSS\\) via libcamera-devel\"\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"\"Xavier Roumegue \\(OSS\\)\" <xavier.roumegue@oss.nxp.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":25333,"web_url":"https://patchwork.libcamera.org/comment/25333/","msgid":"<20221007134044.sgpdalrjimmarm53@uno.localdomain>","date":"2022-10-07T13:40:44","subject":"Re: [libcamera-devel] [PATCH 3/8] ipa: camera_sensor_helper: Return\n\tunique_ptr from createInstance","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Laurent\n\nOn Tue, Oct 04, 2022 at 12:21:23AM +0300, Laurent Pinchart via libcamera-devel wrote:\n> Avoid naked pointer with memory allocation by returning a unique_ptr\n> from CameraSensorHelperFactory::createInstance(), in order to increase\n> memory allocation safety.\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nLooks fine\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\n> ---\n>  src/ipa/libipa/camera_sensor_helper.cpp | 7 +++----\n>  src/ipa/libipa/camera_sensor_helper.h   | 6 +++---\n>  2 files changed, 6 insertions(+), 7 deletions(-)\n>\n> diff --git a/src/ipa/libipa/camera_sensor_helper.cpp b/src/ipa/libipa/camera_sensor_helper.cpp\n> index fde9bf5b8892..3a7d701d8616 100644\n> --- a/src/ipa/libipa/camera_sensor_helper.cpp\n> +++ b/src/ipa/libipa/camera_sensor_helper.cpp\n> @@ -261,8 +261,7 @@ std::unique_ptr<CameraSensorHelper> CameraSensorHelperFactory::create(const std:\n>  \t\tif (name != factory->name_)\n>  \t\t\tcontinue;\n>\n> -\t\tCameraSensorHelper *helper = factory->createInstance();\n> -\t\treturn std::unique_ptr<CameraSensorHelper>(helper);\n> +\t\treturn factory->createInstance();\n>  \t}\n>\n>  \treturn nullptr;\n> @@ -307,8 +306,8 @@ std::vector<CameraSensorHelperFactory *> &CameraSensorHelperFactory::factories()\n>   * macro. It creates a camera sensor helper instance associated with the camera\n>   * sensor model.\n>   *\n> - * \\return A pointer to a newly constructed instance of the CameraSensorHelper\n> - * subclass corresponding to the factory\n> + * \\return A unique pointer to a newly constructed instance of the\n> + * CameraSensorHelper subclass corresponding to the factory\n>   */\n>\n>  /**\n> diff --git a/src/ipa/libipa/camera_sensor_helper.h b/src/ipa/libipa/camera_sensor_helper.h\n> index 410156efb2ea..21ee43cc9f9f 100644\n> --- a/src/ipa/libipa/camera_sensor_helper.h\n> +++ b/src/ipa/libipa/camera_sensor_helper.h\n> @@ -73,7 +73,7 @@ private:\n>\n>  \tstatic void registerType(CameraSensorHelperFactory *factory);\n>\n> -\tvirtual CameraSensorHelper *createInstance() const = 0;\n> +\tvirtual std::unique_ptr<CameraSensorHelper> createInstance() const = 0;\n>\n>  \tstd::string name_;\n>  };\n> @@ -85,9 +85,9 @@ public: \t\t\t\t\t\t\t\\\n>  \thelper##Factory() : CameraSensorHelperFactory(name) {}\t\\\n>  \t\t\t\t\t\t\t\t\\\n>  private:\t\t\t\t\t\t\t\\\n> -\tCameraSensorHelper *createInstance() const\t\t\\\n> +\tstd::unique_ptr<CameraSensorHelper> createInstance() const \\\n>  \t{\t\t\t\t\t\t\t\\\n> -\t\treturn new helper();\t\t\t\t\\\n> +\t\treturn std::make_unique<helper>();\t\t\\\n>  \t}\t\t\t\t\t\t\t\\\n>  };\t\t\t\t\t\t\t\t\\\n>  static helper##Factory global_##helper##Factory;\n> --\n> Regards,\n>\n> Laurent Pinchart\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 AC91EBD16B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  7 Oct 2022 13:40:48 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id F3E9E62D18;\n\tFri,  7 Oct 2022 15:40:47 +0200 (CEST)","from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net\n\t[IPv6:2001:4b98:dc4:8::221])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 781C460A88\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  7 Oct 2022 15:40:46 +0200 (CEST)","(Authenticated sender: jacopo@jmondi.org)\n\tby mail.gandi.net (Postfix) with ESMTPSA id CE9EB240008;\n\tFri,  7 Oct 2022 13:40:45 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1665150048;\n\tbh=f683ubup78Qo2/5VJGPdE3v5fSIAUnOzmKHpI+LmTrI=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=f65dknB60EP5U1w9rMPZPV2KkyaP+6lHA/1StYXzYw+aBN+3b/jTVkI82baMjW8Ly\n\tNjHluHGbAs98ZKi8tL9Ey94miWiQX6chvpBPul66MheQad74DuV1y0T1XbMGotSfVc\n\tZW/Gu2wf9D4I7db1WhtHa8viz8KJC8vIh6rFTZrupTq4H2z4kta0siF3zgRKm0aU69\n\thIdWi9u0hg7ozbGrIP23ba+IyHTi7BchhZ/GALjV/SPcs3317IDKyRcUq8sNxmYhK/\n\tY9A3W0X3KNAwHHvf3oqdvVYe7ZIsu6S38SwOVB0LQ9D6k3fVqylncrzsBu1i2bsNmb\n\tiP+O/eCZ1kW1A==","Date":"Fri, 7 Oct 2022 15:40:44 +0200","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Message-ID":"<20221007134044.sgpdalrjimmarm53@uno.localdomain>","References":"<20221003212128.32429-1-laurent.pinchart@ideasonboard.com>\n\t<20221003212128.32429-4-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20221003212128.32429-4-laurent.pinchart@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 3/8] ipa: camera_sensor_helper: Return\n\tunique_ptr from createInstance","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>","From":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]