[{"id":11672,"web_url":"https://patchwork.libcamera.org/comment/11672/","msgid":"<20200728152743.GF13753@pendragon.ideasonboard.com>","date":"2020-07-28T15:27:43","subject":"Re: [libcamera-devel] [PATCH 0/2] Add Object::deleteLater() support","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Umang,\n\nOn Tue, Jul 28, 2020 at 10:57:21AM +0000, Umang Jain wrote:\n> Implementation of Object::deleteLater() which ensures shared objects\n> are deleted in the thread to which they belong. This fixes the issue\n> where on hot-unplug, the Camera object is deleted in QCam's application\n> thread instead of CameraManager's thread and triggering the ASSERT()\n> in processNotifier (since the event notifier got deleted out of \n> context in a different thread). See [1] for discussion.\n> \n> [1] https://lists.libcamera.org/pipermail/libcamera-devel/2020-July/010951.html\n> \n> Umang Jain (2):\n>   libcamera: object: Add deleteLater() support\n>   libcamera: camera: Ensure deletion via deleteLater()\n> \n>  include/libcamera/camera.h           |  2 +-\n>  include/libcamera/internal/message.h |  1 +\n>  include/libcamera/object.h           |  2 ++\n>  src/libcamera/camera.cpp             |  2 +-\n>  src/libcamera/object.cpp             | 20 ++++++++++++++++++++\n>  5 files changed, 25 insertions(+), 2 deletions(-)\n\nIt's a nice and simple fix :-)\n\nCould you add a test case for Object::deleteLater() ? It should test the\nfunction both when calling from the Object's thread and from a different\nthread. In the first case, it would also be nice to call deleteLater()\ntwice in a row to ensure deletion only occurs once.","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 33426BD878\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 28 Jul 2020 15:27:54 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B96BE613C6;\n\tTue, 28 Jul 2020 17:27:53 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C5A0260923\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 28 Jul 2020 17:27:52 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 3E9A2563;\n\tTue, 28 Jul 2020 17:27:52 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"rg2AVOik\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1595950072;\n\tbh=fgJYB3eu5iAz1VsfxToTVb19XKPg0WDOzDqLmgRVQ7U=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=rg2AVOikF2tkNtn0pD+BMBDdqR8d/5PkXP7VbImsUlxzwtQ0cblwYU1/UKJ/pEf5H\n\tmQCSn/sFg13eetKxOJYetwx+Wy8V3FvGrpKjU7RT9aDDPuWXmA5sz5rEx+ta7/gMVB\n\tRSZ82MialqYptUywCsHb8Q2ZSqZ8KjXciztBJ8dM=","Date":"Tue, 28 Jul 2020 18:27:43 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Umang Jain <email@uajain.com>","Message-ID":"<20200728152743.GF13753@pendragon.ideasonboard.com>","References":"<20200728105541.13326-1-email@uajain.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20200728105541.13326-1-email@uajain.com>","Subject":"Re: [libcamera-devel] [PATCH 0/2] Add Object::deleteLater() support","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>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]