[{"id":3360,"web_url":"https://patchwork.libcamera.org/comment/3360/","msgid":"<20200107190002.GE533370@oden.dyn.berto.se>","date":"2020-01-07T19:00:02","subject":"Re: [libcamera-devel] [PATCH 03/14] libcamera: bound_method: Fix\n\tmemory leak with direct connections","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Laurent,\n\nThanks for your work.\n\nOn 2020-01-04 07:09:36 +0200, Laurent Pinchart wrote:\n> When BoundMethodBase::activatePack() is called with the connection type\n> set to ConnectionTypeDirect, the method isn't deleted even if\n> deleteMethod is true, as is the case when called from\n> Object::invokeMethod(). This causes a memory leak. Fix it.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n> ---\n>  src/libcamera/bound_method.cpp | 2 ++\n>  1 file changed, 2 insertions(+)\n> \n> diff --git a/src/libcamera/bound_method.cpp b/src/libcamera/bound_method.cpp\n> index 4c0cd415a3f1..45c765774801 100644\n> --- a/src/libcamera/bound_method.cpp\n> +++ b/src/libcamera/bound_method.cpp\n> @@ -62,6 +62,8 @@ void BoundMethodBase::activatePack(void *pack, bool deleteMethod)\n>  \tcase ConnectionTypeDirect:\n>  \tdefault:\n>  \t\tinvokePack(pack);\n> +\t\tif (deleteMethod)\n> +\t\t\tdelete this;\n>  \t\tbreak;\n>  \n>  \tcase ConnectionTypeQueued: {\n> -- \n> Regards,\n> \n> Laurent Pinchart\n> \n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from mail-lj1-x241.google.com (mail-lj1-x241.google.com\n\t[IPv6:2a00:1450:4864:20::241])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 29EEA6063B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  7 Jan 2020 20:00:04 +0100 (CET)","by mail-lj1-x241.google.com with SMTP id u71so636606lje.11\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 07 Jan 2020 11:00:04 -0800 (PST)","from localhost (h-93-159.A463.priv.bahnhof.se. [46.59.93.159])\n\tby smtp.gmail.com with ESMTPSA id\n\ty1sm214251ljm.12.2020.01.07.11.00.02\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 07 Jan 2020 11:00:03 -0800 (PST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to;\n\tbh=nUyrZA+hUdIOrKkZeQ7lqQ45LyEU2Tvgauy74pgVJUM=;\n\tb=1yW7fbrXvtJcAcrUsBR0gY2ATD5j4jelPsUGNAwjLj1JymJUu5uqY+egx4+KY+vTKu\n\tDkxThfnuGHFchDDPAipaVGkvqGL6OcnPlOeFZK9/bBGJZQuT2hHakBbEQHe3X1UCQvDH\n\tyWTAQtXHV5ByRd9KrBmhpGCVxZV1lBxI+WUlSiKKo10F4TbEwdliZF3WtVA52fzNe5HC\n\tx/qDIXjBUzZ6fWkd2C9qJAhi3/ksM1acWHMqXlDp13dYrH80ljNrJxap4RSKB/F/S0UC\n\tZ7J4FZyPMzG6FQ3ae+9gA0wyWhCNjlUAhSgwxtJLQoV3baLt+qIJgAna5TemID72bJoH\n\tXzlg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to;\n\tbh=nUyrZA+hUdIOrKkZeQ7lqQ45LyEU2Tvgauy74pgVJUM=;\n\tb=A5DTAzxBNdoSbIVaWSdPkCN6XgBEd9yKFYviWcrhUOM3N4lF9eq8IkSG/4K77sE66P\n\thfxtEe0OBpgGbRDMEi2+eMNf3S1V9KNlASwAIiBvqUnYdbKCrFSE7ltZZ4y4Q3CRALro\n\tOaEnoXwS2EhOZNXhtYyxnvUjXNLe3g+vsrU1AxLXch12DxGkdxBgyYzofx3oikacrOXi\n\t0OFTcDKtFViz/tpzGvt2LBelpRYEAXkZdDBZyG96I2qEasSk4p95WVup4MJVkIDHnPXA\n\t8QLZ6dgMRre4Pz7wei6Qg95BUftPSPtbjoGETPcgzFMaAcnujrP5iaiJeaxIYyL/qyLV\n\toEgw==","X-Gm-Message-State":"APjAAAVjXUZrS5K3+R5uFQAHjitbsRiYajC5TIkhrVTSSYNNuJWLpmTZ\n\tYWvrfaRlYcjkYVcGrYIU/4qHCA==","X-Google-Smtp-Source":"APXvYqyESLZh3UbY8WOX2xnxKcRR27FmSKQgMh5eeC9UkDgh7tWFtEHjhzpbxThI9BWKBKyTGQcZLw==","X-Received":"by 2002:a2e:93d5:: with SMTP id p21mr589351ljh.50.1578423603584; \n\tTue, 07 Jan 2020 11:00:03 -0800 (PST)","Date":"Tue, 7 Jan 2020 20:00:02 +0100","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20200107190002.GE533370@oden.dyn.berto.se>","References":"<20200104050947.7673-1-laurent.pinchart@ideasonboard.com>\n\t<20200104050947.7673-4-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20200104050947.7673-4-laurent.pinchart@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 03/14] libcamera: bound_method: Fix\n\tmemory leak with direct connections","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>","X-List-Received-Date":"Tue, 07 Jan 2020 19:00:04 -0000"}}]