From 4e86d997141dc7cd9e83b6c6a4a47ebdcaa4ebd6 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Mon, 15 Jul 2019 20:41:42 +0200 Subject: Cleanup: free plot data on exit Some widgets copy the full plot info. Free these data on exit to prevent monstrous valgrind reports. Signed-off-by: Berthold Stoeger --- qt-models/diveplotdatamodel.cpp | 5 +++++ qt-models/diveplotdatamodel.h | 1 + 2 files changed, 6 insertions(+) (limited to 'qt-models') diff --git a/qt-models/diveplotdatamodel.cpp b/qt-models/diveplotdatamodel.cpp index d89ab6f31..164cd04a4 100644 --- a/qt-models/diveplotdatamodel.cpp +++ b/qt-models/diveplotdatamodel.cpp @@ -14,6 +14,11 @@ DivePlotDataModel::DivePlotDataModel(QObject *parent) : memset(&plot_deco_state, 0, sizeof(struct deco_state)); } +DivePlotDataModel::~DivePlotDataModel() +{ + free_plot_info_data(&pInfo); +} + int DivePlotDataModel::columnCount(const QModelIndex&) const { return COLUMNS; diff --git a/qt-models/diveplotdatamodel.h b/qt-models/diveplotdatamodel.h index 87c31198d..6267d3705 100644 --- a/qt-models/diveplotdatamodel.h +++ b/qt-models/diveplotdatamodel.h @@ -73,6 +73,7 @@ public: COLUMNS }; explicit DivePlotDataModel(QObject *parent = 0); + ~DivePlotDataModel(); int columnCount(const QModelIndex &parent = QModelIndex()) const override; QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; -- cgit v1.2.3-70-g09d2