From patchwork Tue Jul 28 10:57:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 9041 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 2240CBD878 for ; Tue, 28 Jul 2020 10:57:25 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 860146118A; Tue, 28 Jul 2020 12:57:24 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=uajain.com header.i=@uajain.com header.b="dtbfiTmS"; dkim-atps=neutral Received: from o1.f.az.sendgrid.net (o1.f.az.sendgrid.net [208.117.55.132]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 87E0C6039B for ; Tue, 28 Jul 2020 12:57:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uajain.com; h=from:subject:mime-version:to:cc:content-transfer-encoding: content-type; s=s1; bh=Zgj0KXmF8KqUaqskx1vOUOLr6jeAxbSr7of9Dl2z9cQ=; b=dtbfiTmSHjRlNvg+3gdSY99kcMuT75tbIfjWfNbu3JmBmd3FVULP7UZL/z+BRiEbZwhM t6qV+IRhcOENpi16BZ/xHmRPTpNs3c9FKGwFWyuZntUHj2vdJrzcw8GSil4AR4YTA6Fxqv cOlsDKNRZ4nuiYacIE1W2NDF6VW2rCTow= Received: by filterdrecv-p3mdw1-75c584b9c6-xjd6c with SMTP id filterdrecv-p3mdw1-75c584b9c6-xjd6c-20-5F200490-41 2020-07-28 10:57:20.988124886 +0000 UTC m=+2742462.960815625 Received: from mail.uajain.com (unknown) by ismtpd0006p1maa1.sendgrid.net (SG) with ESMTP id zsqRzYOJTZeRvohHGNc8rg for ; Tue, 28 Jul 2020 10:57:20.356 +0000 (UTC) From: Umang Jain Date: Tue, 28 Jul 2020 10:57:21 +0000 (UTC) Message-Id: <20200728105541.13326-1-email@uajain.com> Mime-Version: 1.0 X-SG-EID: 1Q40EQ7YGir8a9gjSIAdTjhngY657NMk9ckeo4dbHZDiOpywc/L3L9rFqlwE4KPcytdNsKVIgBmp5SVZAuCwQaY1Bb8oWQIjU/3JeAFn0FsvWzRk1MSlaKDElgoBrhzCJ2LVogyudmcNXgfuqXZiP1qx2jQk5JtYzR3Stg3I2stKmNxunlqqEo/Pn4RRCbA4BV2AE8gM/EM+dZ5mXjCJR/C4jVsrLvgl94vxLcO9YHePk00R2i+bWITTncsmK3sFKyHuKI2zK68/3nJBOfLzYg== To: libcamera-devel@lists.libcamera.org Subject: [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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Implementation of Object::deleteLater() which ensures shared objects are deleted in the thread to which they belong. This fixes the issue where on hot-unplug, the Camera object is deleted in QCam's application thread instead of CameraManager's thread and triggering the ASSERT() in processNotifier (since the event notifier got deleted out of context in a different thread). See [1] for discussion. [1] https://lists.libcamera.org/pipermail/libcamera-devel/2020-July/010951.html Umang Jain (2): libcamera: object: Add deleteLater() support libcamera: camera: Ensure deletion via deleteLater() include/libcamera/camera.h | 2 +- include/libcamera/internal/message.h | 1 + include/libcamera/object.h | 2 ++ src/libcamera/camera.cpp | 2 +- src/libcamera/object.cpp | 20 ++++++++++++++++++++ 5 files changed, 25 insertions(+), 2 deletions(-)