summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-03-06 14:26:33 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-03-06 14:26:33 -0800
commitc64227efe02868438c7afe2339c89014fc285ee2 (patch)
tree6d1d372bb9be0e00f720c6c55de60f3b45bcd76a
parent3e8e005aa322784ace8b342b9509c831042708f5 (diff)
downloadsubsurface-c64227efe02868438c7afe2339c89014fc285ee2.tar.gz
Fix real memory leak
We can't keep the cache around (even though it's tempting) as the next iteration might change the start time of the planned dive or other parameters which would make the cached data invalid. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/diveplanner.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp
index 32e957363..b4ca5ba89 100644
--- a/qt-ui/diveplanner.cpp
+++ b/qt-ui/diveplanner.cpp
@@ -1445,6 +1445,8 @@ void DivePlannerPointsModel::createTemporaryPlan()
copy_samples(tempDive, current_dive);
copy_events(tempDive, current_dive);
}
+ // throw away the cache
+ free(cache);
#if DEBUG_PLAN
dump_plan(&diveplan);
#endif