{"id":13769,"url":"https://patchwork.libcamera.org/api/patches/13769/?format=json","web_url":"https://patchwork.libcamera.org/patch/13769/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20210908134338.402504-1-vedantparanjape160201@gmail.com>","date":"2021-09-08T13:43:38","name":"[libcamera-devel,v2] test: gstreamer: Fix the destructor of GstreamerTest base class","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"6320839b6b5970e8aca33dbffdd74bc5b56b8c56","submitter":{"id":85,"url":"https://patchwork.libcamera.org/api/people/85/?format=json","name":"Vedant Paranjape","email":"vedantparanjape160201@gmail.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/13769/mbox/","series":[{"id":2500,"url":"https://patchwork.libcamera.org/api/series/2500/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2500","date":"2021-09-08T13:43:38","name":"[libcamera-devel,v2] test: gstreamer: Fix the destructor of GstreamerTest base class","version":2,"mbox":"https://patchwork.libcamera.org/series/2500/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/13769/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/13769/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 C2501BDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  8 Sep 2021 13:44:13 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4968B69167;\n\tWed,  8 Sep 2021 15:44:13 +0200 (CEST)","from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com\n\t[IPv6:2607:f8b0:4864:20::1036])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 62E1F60503\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  8 Sep 2021 15:44:11 +0200 (CEST)","by mail-pj1-x1036.google.com with SMTP id c6so1718963pjv.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 08 Sep 2021 06:44:11 -0700 (PDT)","from localhost.localdomain ([1.186.166.2])\n\tby smtp.googlemail.com with ESMTPSA id\n\tz6sm2394813pjn.27.2021.09.08.06.44.08\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 08 Sep 2021 06:44:09 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"cNoMCwQX\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;\n\th=from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=tEQUGxtrUNWZ8NS6La3b3j2oH5qioeLu+nKQomhr75g=;\n\tb=cNoMCwQXso8uA5bBW/XfEBQBGJZQOqx2lJZv26/atDibCdZrHtn5/qR43mWKGKyoWG\n\t8XHpnlgL1XUB3iW17cHjzqoCrRG0eCjMtBshQXUyb7+Tnd3GwAFpptaSfJyyNE+NlPJq\n\tQbfHvoKnPj8d7XLFN9N1281vdkuVPT6Z7RVYnXH9P8Gaq1EY7l0BYSMdEcavD9JZuxxW\n\tUpsqwyRS5UplcPhVyElmo/mS30ACoVzGb2i57bJGBnWiqSak4h6RWi+rZGCq29Bq1BWv\n\t78PcfKqB9N6opv8O90YK/rm18RzOlqhdKVhUM/jCqVym6rVH4gL/z3Q7HDcl7eBrpeaN\n\tuU6Q==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=tEQUGxtrUNWZ8NS6La3b3j2oH5qioeLu+nKQomhr75g=;\n\tb=4LF9JsHx2LzSgk8DDOiukpLqwX4ME3q43c1ocJuOE2r51LaJAY/hqOl6InteZCvHcC\n\tL1vNIK3AevYwBS3D+hT9t716nrCXh2R3jMOBok/AQ4G6h2H6ssp/rQs6BgJXBCt/a4Dx\n\tpsuu1NR2mpiB4whFuIxLhyTgUalcz7T6uufbiKcGvMCxEkT9LD9PoraUDuwDfXHjIhon\n\tD3ld1a+MU9s2kbN/ZWHRB/EJ3vhpq96HU+0aRyJe44St8p3vAbEVckBhpAlIPpEqD9RE\n\tS/la3ZHmUFJn/+ZLerjSIHJoUJaBxRADfDNYVsFePxqJWjKLIgu7kwLslcyUO/ay4eEH\n\tDubQ==","X-Gm-Message-State":"AOAM530LNnG9v6jc6paPWy4oelZsQwxqlrMaervEFjZz5Uqhq4p7oyQ3\n\tLIfwUH6PZfF3NAXbrYJGoVgDxQZvEK3xS6Nq","X-Google-Smtp-Source":"ABdhPJyyOCemcAf1Mg5AF7O+l8HBMP+MYB43c+dUwTr++hh4udmWt9aR5gmLsl8hA9pLC4cRcTspdA==","X-Received":"by 2002:a17:902:784c:b0:138:f4e5:9df8 with SMTP id\n\te12-20020a170902784c00b00138f4e59df8mr3164041pln.14.1631108649549; \n\tWed, 08 Sep 2021 06:44:09 -0700 (PDT)","From":"Vedant Paranjape <vedantparanjape160201@gmail.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Wed,  8 Sep 2021 19:13:38 +0530","Message-Id":"<20210908134338.402504-1-vedantparanjape160201@gmail.com>","X-Mailer":"git-send-email 2.25.1","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v2] test: gstreamer: Fix the destructor of\n\tGstreamerTest base class","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":"Vedant Paranjape <vedantparanjape160201@gmail.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"The destructor tried to check if pipeline_ is a parent of libcameraSrc_.\nThis was needed to be checked as if it is, cleanup of libcameraSrc_\nwould be handled by pipeline itself.\n\nSince, the destructor can be called anytime, even when pipeline_ hasn't\nbeen created, the use of pipeline_ to check if libcameraSrc_ has an\nancestor as pipeline_ caused a segmentation fault.\n\nFixes: f58768092277 (\"test: gstreamer: Fix the destructor of GstreamerTest base class\")\nSigned-off-by: Vedant Paranjape <vedantparanjape160201@gmail.com>\n---\n test/gstreamer/gstreamer_test.cpp | 8 ++------\n 1 file changed, 2 insertions(+), 6 deletions(-)","diff":"diff --git a/test/gstreamer/gstreamer_test.cpp b/test/gstreamer/gstreamer_test.cpp\nindex dbdcaec0b111..f1a40fcb062a 100644\n--- a/test/gstreamer/gstreamer_test.cpp\n+++ b/test/gstreamer/gstreamer_test.cpp\n@@ -69,12 +69,8 @@ GstreamerTest::GstreamerTest()\n \n GstreamerTest::~GstreamerTest()\n {\n-\tif (libcameraSrc_ &&\n-\t    !gst_object_has_as_ancestor(GST_OBJECT(libcameraSrc_),\n-\t\t\t\t\tGST_OBJECT(pipeline_)))\n-\t\tgst_object_unref(libcameraSrc_);\n-\tif (pipeline_)\n-\t\tgst_object_unref(pipeline_);\n+\tgst_object_clear(pipeline_);\n+\tgst_object_clear(libcameraSrc_);\n \n \tgst_deinit();\n }\n","prefixes":["libcamera-devel","v2"]}