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>
This commit is contained in:
Dirk Hohndel 2017-05-29 10:32:32 -07:00
parent 76a38b6326
commit 57d01701aa
2 changed files with 12 additions and 3 deletions

View file

@ -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;