summaryrefslogtreecommitdiffstats
path: root/profile-widget/tankitem.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-07-15 20:41:42 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-11-09 19:19:04 +0100
commit4e86d997141dc7cd9e83b6c6a4a47ebdcaa4ebd6 (patch)
treec211c83947404bef6c0e64ba5f7ea4d531e42a1f /profile-widget/tankitem.cpp
parent05a5a06fd3905db25208a0f794b54cf27e580904 (diff)
downloadsubsurface-4e86d997141dc7cd9e83b6c6a4a47ebdcaa4ebd6.tar.gz
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 <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'profile-widget/tankitem.cpp')
-rw-r--r--profile-widget/tankitem.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/profile-widget/tankitem.cpp b/profile-widget/tankitem.cpp
index ea50dd9cf..f40baa357 100644
--- a/profile-widget/tankitem.cpp
+++ b/profile-widget/tankitem.cpp
@@ -32,6 +32,11 @@ TankItem::TankItem(QObject *parent) :
hAxis = nullptr;
}
+TankItem::~TankItem()
+{
+ free(pInfoEntry);
+}
+
void TankItem::setData(DivePlotDataModel *model, struct plot_info *plotInfo, struct dive *d)
{
// If there is nothing to plot, quit early.