summaryrefslogtreecommitdiffstats
path: root/qt-ui/diveplanner.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-06-27 17:31:10 -0300
committerGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-06-27 17:31:10 -0300
commit19fbc108c3359cafb9ac76bca20df68fc58624a2 (patch)
treeb69bb2abddba7f4f9c6dc9bd1ca2c7144f09e6a7 /qt-ui/diveplanner.cpp
parentc7c5ca7c3e1f4f9fb3d6a49a4b6eb2bcfdf2fb24 (diff)
downloadsubsurface-19fbc108c3359cafb9ac76bca20df68fc58624a2.tar.gz
Removed memleak created by the diveplan calculations
Removed a small memleak created by the diveplan calculations. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Diffstat (limited to 'qt-ui/diveplanner.cpp')
-rw-r--r--qt-ui/diveplanner.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp
index a8f45d91f..1aaf5aa7d 100644
--- a/qt-ui/diveplanner.cpp
+++ b/qt-ui/diveplanner.cpp
@@ -195,6 +195,16 @@ void DivePlannerGraphics::createDecoStops()
scene()->addItem(item);
lines << item;
}
+
+ deleteTemporaryDivePlan(diveplan.dp);
+}
+
+void DivePlannerGraphics::deleteTemporaryDivePlan(divedatapoint* dp)
+{
+ if (!dp)
+ return;
+ deleteTemporaryDivePlan(dp->next);
+ free(dp);
}
void DivePlannerGraphics::resizeEvent(QResizeEvent* event)