summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/downloadfromdivecomputer.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2017-05-29 10:32:32 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-05-29 10:35:21 -0700
commit57d01701aa81f7b1033ff0b19a2d128554aeed7d (patch)
tree8e1328433f906fde25b857b80ed4dc4995fa4e98 /desktop-widgets/downloadfromdivecomputer.cpp
parent76a38b63269f554f3299e8ddfb1ea335bbc932d5 (diff)
downloadsubsurface-57d01701aa81f7b1033ff0b19a2d128554aeed7d.tar.gz
Don't leak memory on downloaded dives not picked
I noticed this in the mobile download code when fixing an unrelated issue - and then realized that the same was true in the desktop app as well. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'desktop-widgets/downloadfromdivecomputer.cpp')
-rw-r--r--desktop-widgets/downloadfromdivecomputer.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/desktop-widgets/downloadfromdivecomputer.cpp b/desktop-widgets/downloadfromdivecomputer.cpp
index 2d834359e..5400f62ed 100644
--- a/desktop-widgets/downloadfromdivecomputer.cpp
+++ b/desktop-widgets/downloadfromdivecomputer.cpp
@@ -421,6 +421,8 @@ void DownloadFromDCWidget::on_ok_clicked()
for (int i = 0; i < downloadTable.nr; i++) {
if (diveImportedModel->data(diveImportedModel->index(i, 0),Qt::CheckStateRole) == Qt::Checked)
record_dive(downloadTable.dives[i]);
+ else
+ clear_dive(downloadTable.dives[i]);
downloadTable.dives[i] = NULL;
}
downloadTable.nr = 0;