aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qt-ui/diveplanner.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp
index 39db8f431..c54cb9b19 100644
--- a/qt-ui/diveplanner.cpp
+++ b/qt-ui/diveplanner.cpp
@@ -431,6 +431,13 @@ void DivePlannerPointsModel::loadFromDive(dive* d)
* as soon as the model is modified, it will
* remove all samples from the current dive.
* */
+
+ /* On the safe side, clear everything before
+ editing the new dive. */
+ beginRemoveRows(QModelIndex(), 0, rowCount()-1);
+ divepoints.clear();
+ endRemoveRows();
+
backupSamples.clear();
for(int i = 1; i < d->dc.samples-1; i++){
backupSamples.push_back( d->dc.sample[i]);