summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qt-ui/profile/tankitem.cpp7
-rw-r--r--qt-ui/profile/tankitem.h1
2 files changed, 8 insertions, 0 deletions
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);