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 +++++++ 1 file changed, 7 insertions(+) (limited to 'qt-ui/profile/tankitem.cpp') 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); -- cgit v1.2.3-70-g09d2