Show a patch.

GET /api/patches/9043/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 9043,
    "url": "https://patchwork.libcamera.org/api/patches/9043/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/9043/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20200728105541.13326-3-email@uajain.com>",
    "date": "2020-07-28T10:57:25",
    "name": "[libcamera-devel,2/2] libcamera: camera: Ensure deletion via deleteLater()",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "93d0ad5ba5c3cc1121d8c32da6fba80ff9a4ec50",
    "submitter": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/people/1/?format=api",
        "name": "Umang Jain",
        "email": "email@uajain.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/9043/mbox/",
    "series": [
        {
            "id": 1156,
            "url": "https://patchwork.libcamera.org/api/series/1156/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1156",
            "date": "2020-07-28T10:57:21",
            "name": "Add Object::deleteLater() support",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/1156/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/9043/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/9043/checks/",
    "tags": {},
    "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 E48B8BD878\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 28 Jul 2020 10:57:29 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id AE1D8613C6;\n\tTue, 28 Jul 2020 12:57:29 +0200 (CEST)",
            "from o1.f.az.sendgrid.net (o1.f.az.sendgrid.net [208.117.55.132])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2DCAF616FF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 28 Jul 2020 12:57:27 +0200 (CEST)",
            "by filterdrecv-p3mdw1-75c584b9c6-q9wps with SMTP id\n\tfilterdrecv-p3mdw1-75c584b9c6-q9wps-21-5F200495-4C\n\t2020-07-28 10:57:25.902086811 +0000 UTC m=+2742468.798483178",
            "from mail.uajain.com (unknown)\n\tby ismtpd0005p1maa1.sendgrid.net (SG) with ESMTP id\n\tV5L735IlQI6Vdnx2fPbSrQ for <libcamera-devel@lists.libcamera.org>;\n\tTue, 28 Jul 2020 10:57:25.496 +0000 (UTC)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=uajain.com header.i=@uajain.com\n\theader.b=\"bkXCQ4FK\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=uajain.com;\n\th=from:subject:in-reply-to:references:mime-version:to:cc:\n\tcontent-transfer-encoding:content-type;\n\ts=s1; bh=LKCN+mo/nQECRcf0uO/mA1y+PjqUsP1EpSA93LxFroY=;\n\tb=bkXCQ4FKggoC8whK4vzVIagKwJLbEFHPSGdTwcz1aV4hf8KCC2HeSUaag/8QdZr3Nv0g\n\t0pW3Zrfx8rrr6iCqKQVyYG9glZbBc2vOc0evkk5nK0n8elU+kvMM2G9wNjT5bSsZPDxeht\n\tkEBzh9+USozgbRm6ZqaTqp4sFy5I6QP8I=",
        "From": "Umang Jain <email@uajain.com>",
        "Date": "Tue, 28 Jul 2020 10:57:25 +0000 (UTC)",
        "Message-Id": "<20200728105541.13326-3-email@uajain.com>",
        "In-Reply-To": "<20200728105541.13326-1-email@uajain.com>",
        "References": "<20200728105541.13326-1-email@uajain.com>",
        "Mime-Version": "1.0",
        "X-SG-EID": "1Q40EQ7YGir8a9gjSIAdTjhngY657NMk9ckeo4dbHZDiOpywc/L3L9rFqlwE4KPc/qk5sBUbMs3SDc71Zia+EPPl8QFrE3sWnDV6QCaTwNApz2N86mNxUJ0CEM2nVAO4uPigtjdaq0fQErk0X4IuyMqCQpDBXU/HGO3jBYfp1Zs0F9smtLq97JRdtgwGWI20x5BKhpUTfRAvx0oqlewpBqgUQ16jvxVOwMoDNEwQ4J38YV7ceXs/XYYRNITyMD9WQg5g3fcFl1/1X756JpnDSw==",
        "To": "libcamera-devel@lists.libcamera.org",
        "Subject": "[libcamera-devel] [PATCH 2/2] libcamera: camera: Ensure deletion\n\tvia deleteLater()",
        "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>",
        "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>"
    },
    "content": "Object::deleteLater() ensures that the deletion of the Object\ntakes place in a thread it is bound to. Deleting the Object\nin a different thread is a violation according to the threading\nmodel.\n\nOn hot-unplug of a currently streaming camera, the last reference\nof Camera when dropped from the application thread (for e.g. QCam's\nthread), the destructor is then called from this thread. This is not\nallowed by the threading model. Camera is meant to be deleted in the\nthread it is bound to - in this case the CameraManager's thread.\n\nSigned-off-by: Umang Jain <email@uajain.com>\n---\n include/libcamera/camera.h | 2 +-\n src/libcamera/camera.cpp   | 2 +-\n 2 files changed, 2 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/include/libcamera/camera.h b/include/libcamera/camera.h\nindex 4d1a4a9..beb87e6 100644\n--- a/include/libcamera/camera.h\n+++ b/include/libcamera/camera.h\n@@ -66,7 +66,7 @@ protected:\n \tstd::vector<StreamConfiguration> config_;\n };\n \n-class Camera final : public std::enable_shared_from_this<Camera>\n+class Camera final : public Object, public std::enable_shared_from_this<Camera>\n {\n public:\n \tstatic std::shared_ptr<Camera> create(PipelineHandler *pipe,\ndiff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp\nindex 69a1b44..034f341 100644\n--- a/src/libcamera/camera.cpp\n+++ b/src/libcamera/camera.cpp\n@@ -464,7 +464,7 @@ std::shared_ptr<Camera> Camera::create(PipelineHandler *pipe,\n \tstruct Deleter : std::default_delete<Camera> {\n \t\tvoid operator()(Camera *camera)\n \t\t{\n-\t\t\tdelete camera;\n+\t\t\tcamera->deleteLater();\n \t\t}\n \t};\n \n",
    "prefixes": [
        "libcamera-devel",
        "2/2"
    ]
}