aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/mainwindow.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-06 12:09:20 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-06 12:09:20 -0700
commit6ebeba3c7c142994051061c495850827e51b552f (patch)
tree6eeedd6938a2dfd1b145ea29bbdb1a7b83111fa5 /qt-ui/mainwindow.cpp
parent56913191af919186343029a4e5c0cc8ecc345490 (diff)
downloadsubsurface-6ebeba3c7c142994051061c495850827e51b552f.tar.gz
Be more careful freeing taxonomy data
We want to only access data that we consider valid. And we need to clear out pointers to freed memory. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/mainwindow.cpp')
-rw-r--r--qt-ui/mainwindow.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index 2ea4766ab..305ddf6dc 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -631,6 +631,7 @@ void MainWindow::setupForAddAndPlan(const char *model)
{
// clean out the dive and give it an id and the correct dc model
clear_dive(&displayed_dive);
+ clear_dive_site(&displayed_dive_site);
displayed_dive.id = dive_getUniqID(&displayed_dive);
displayed_dive.when = QDateTime::currentMSecsSinceEpoch() / 1000L + gettimezoneoffset() + 3600;
displayed_dive.dc.model = model; // don't translate! this is stored in the XML file