summaryrefslogtreecommitdiffstats
path: root/qt-ui/downloadfromdivecomputer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/downloadfromdivecomputer.cpp')
-rw-r--r--qt-ui/downloadfromdivecomputer.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/qt-ui/downloadfromdivecomputer.cpp b/qt-ui/downloadfromdivecomputer.cpp
index 26635c6e8..a5b3d617c 100644
--- a/qt-ui/downloadfromdivecomputer.cpp
+++ b/qt-ui/downloadfromdivecomputer.cpp
@@ -378,7 +378,13 @@ void DownloadFromDCWidget::onDownloadThreadFinished()
} else {
process_dives(true, preferDownloaded());
}
- } else {
+ } else if (currentState == CANCELLING || currentState == CANCELLED){
+ if (import_thread_cancelled) {
+ // walk backwards so we don't keep moving the dives
+ // down in the dive_table
+ for (int i = dive_table.nr - 1; i >= previousLast; i--)
+ delete_single_dive(i);
+ }
updateState(CANCELLED);
}
}