From f14ef84c9a944e407396d6985dc3b8623f3a613b Mon Sep 17 00:00:00 2001 From: Anton Lundin Date: Thu, 18 Dec 2014 08:47:53 +0100 Subject: Free descriptions copied for TankItem Signed-off-by: Anton Lundin Signed-off-by: Dirk Hohndel --- qt-ui/profile/tankitem.cpp | 7 +++++++ qt-ui/profile/tankitem.h | 1 + 2 files changed, 8 insertions(+) (limited to 'qt-ui') diff --git a/qt-ui/profile/tankitem.cpp b/qt-ui/profile/tankitem.cpp index 42692aacd..619368051 100644 --- a/qt-ui/profile/tankitem.cpp +++ b/qt-ui/profile/tankitem.cpp @@ -33,6 +33,13 @@ TankItem::TankItem(QObject *parent) : memset(&diveCylinderStore, 0, sizeof(diveCylinderStore)); } +TankItem::~TankItem() +{ + // Should this be clear_dive(diveCylinderStore)? + for (int i = 0; i < MAX_CYLINDERS; i++) + free((void *)diveCylinderStore.cylinder[i].type.description); +} + void TankItem::setData(DivePlotDataModel *model, struct plot_info *plotInfo, struct dive *d) { free(pInfoEntry); diff --git a/qt-ui/profile/tankitem.h b/qt-ui/profile/tankitem.h index f8d4ac9f8..d5c4b7f37 100644 --- a/qt-ui/profile/tankitem.h +++ b/qt-ui/profile/tankitem.h @@ -15,6 +15,7 @@ class TankItem : public QObject, public QGraphicsRectItem public: explicit TankItem(QObject *parent = 0); + ~TankItem(); void setHorizontalAxis(DiveCartesianAxis *horizontal); void setData(DivePlotDataModel *model, struct plot_info *plotInfo, struct dive *d); -- cgit v1.2.3-70-g09d2