From patchwork Thu Mar 14 15:10:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 10853079 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 452D317EF for ; Thu, 14 Mar 2019 15:10:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 323962A0A7 for ; Thu, 14 Mar 2019 15:10:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 30DDA2A393; Thu, 14 Mar 2019 15:10:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4CB612A0A7 for ; Thu, 14 Mar 2019 15:10:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727136AbfCNPKo (ORCPT ); Thu, 14 Mar 2019 11:10:44 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:43484 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726360AbfCNPKo (ORCPT ); Thu, 14 Mar 2019 11:10:44 -0400 Received: by mail-pg1-f196.google.com with SMTP id l11so4166701pgq.10 for ; Thu, 14 Mar 2019 08:10:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=MerWo/Szyw4Ske9918mV64pxeqlf7o8QeUj4VVt6/pA=; b=oamIJjxZA3NAp+weceJM+k4VlYOJ1UPeFuMrChx8UOR3UcCENnF8R0foefy7t/ZsQu sCQtiKgBcYspqx3oHD3AAvVLgrFE2QbVOJoHfJj6fmFCymfMaJpTC3SmzT//1e83Oxlj yE/iIZ2EpKR3J0qljB1WFZQRBrxy/ZGUGapqednNxUv/QuBjwDHLm0rGHiWAoMxyoV4a mVDqrNhYE1wkb9ILStE1h++C0GZACZokIQw/5BsdroegSCKh/CELHorokBKFBte8puhh SRV8hyjI6IlXKSEOnt68ZAtYflJ84/hODtY94CuWU3rc2cXcNLIyplsbAUgUE8mMWoKI suEQ== X-Gm-Message-State: APjAAAXHmaRi+Ze8SEz1PAYTUBV1m29fYYs1oLNkXdLR5RG03csZAjSW uY/fpYPQmCTSFK3ffJhu4laXFjYF X-Google-Smtp-Source: APXvYqyI/onD/OnfS+GuucauzCZUw5bM9ExRIEhkQpMspte2hkcS++z2yvBryJPIH7s7eGO0AwSH4Q== X-Received: by 2002:a65:6259:: with SMTP id q25mr45914596pgv.235.1552576243337; Thu, 14 Mar 2019 08:10:43 -0700 (PDT) Received: from mamba.eng.vmware.com ([146.247.46.5]) by smtp.gmail.com with ESMTPSA id f65sm8165585pfg.98.2019.03.14.08.10.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Mar 2019 08:10:42 -0700 (PDT) From: Yordan Karadzhov To: rostedt@goodmis.org Cc: linux-trace-devel@vger.kernel.org Subject: [PATCH 07/12] kernel-shark: Add destructor for KsGLWidget Date: Thu, 14 Mar 2019 17:10:07 +0200 Message-Id: <20190314151012.905-8-ykaradzhov@vmware.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190314151012.905-1-ykaradzhov@vmware.com> References: <20190314151012.905-1-ykaradzhov@vmware.com> MIME-Version: 1.0 Sender: linux-trace-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Not sure how I missed to define this destructor before. The good thing is that the GUI has only one GL widget, and this widget stays alive for the whole duration of the program. Signed-off-by: Yordan Karadzhov --- kernel-shark/src/KsGLWidget.cpp | 6 ++++++ kernel-shark/src/KsGLWidget.hpp | 2 ++ 2 files changed, 8 insertions(+) diff --git a/kernel-shark/src/KsGLWidget.cpp b/kernel-shark/src/KsGLWidget.cpp index 7a050c2..a2fcb8a 100644 --- a/kernel-shark/src/KsGLWidget.cpp +++ b/kernel-shark/src/KsGLWidget.cpp @@ -40,6 +40,12 @@ KsGLWidget::KsGLWidget(QWidget *parent) connect(&_model, SIGNAL(modelReset()), this, SLOT(update())); } +KsGLWidget::~KsGLWidget() +{ + for (auto &g: _graphs) + delete g; +} + /** Reimplemented function used to set up all required OpenGL resources. */ void KsGLWidget::initializeGL() { diff --git a/kernel-shark/src/KsGLWidget.hpp b/kernel-shark/src/KsGLWidget.hpp index 95f307b..3bcecf9 100644 --- a/kernel-shark/src/KsGLWidget.hpp +++ b/kernel-shark/src/KsGLWidget.hpp @@ -31,6 +31,8 @@ class KsGLWidget : public QOpenGLWidget public: explicit KsGLWidget(QWidget *parent = NULL); + ~KsGLWidget(); + void initializeGL() override; void resizeGL(int w, int h) override;