From 6cf06fb61d468339ef2091d3846840c7b00e41c7 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger <bstoeger@mail.tuwien.ac.at> Date: Mon, 8 Jan 2018 19:43:01 +0100 Subject: [PATCH] Remove unnecessary deletes in destructor of ProfileWidget2 All the deleted items were added to the scene, which takes "ownership" (a remarkably fuzzy concept in Qt) of these objects. In principle, deleting these items is a bug - even though it is handled gracefully. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at> --- profile-widget/profilewidget2.cpp | 37 ------------------------------- profile-widget/profilewidget2.h | 1 - 2 files changed, 38 deletions(-) diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp index 3a8b6173a..e1e35ef84 100644 --- a/profile-widget/profilewidget2.cpp +++ b/profile-widget/profilewidget2.cpp @@ -166,43 +166,6 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) : QGraphicsView(parent), #endif } - -ProfileWidget2::~ProfileWidget2() -{ - delete background; - delete profileYAxis; - delete gasYAxis; - delete temperatureAxis; - delete timeAxis; - delete diveProfileItem; - delete temperatureItem; - delete meanDepthItem; - delete cylinderPressureAxis; - delete gasPressureItem; - delete diveComputerText; - delete reportedCeiling; - delete pn2GasItem; - delete pheGasItem; - delete po2GasItem; - delete o2SetpointGasItem; - delete ccrsensor1GasItem; - delete ccrsensor2GasItem; - delete ccrsensor3GasItem; -#ifndef SUBSURFACE_MOBILE - delete toolTipItem; - delete diveCeiling; - delete heartBeatAxis; - delete heartBeatItem; - delete percentageAxis; - delete ambPressureItem; - delete gflineItem; - delete mouseFollowerVertical; - delete mouseFollowerHorizontal; - delete rulerItem; -#endif - delete tankItem; -} - #define SUBSURFACE_OBJ_DATA 1 #define SUBSURFACE_OBJ_DC_TEXT 0x42 diff --git a/profile-widget/profilewidget2.h b/profile-widget/profilewidget2.h index 64fac0451..8c61952b4 100644 --- a/profile-widget/profilewidget2.h +++ b/profile-widget/profilewidget2.h @@ -137,7 +137,6 @@ slots: // Necessary to call from QAction's signals. #endif protected: - virtual ~ProfileWidget2(); void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; #ifndef SUBSURFACE_MOBILE void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE;