diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-05-27 20:31:18 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-05-27 20:31:18 -0700 |
commit | b08969ac3392798b5e6ae37982b51e45d8cffaf1 (patch) | |
tree | 12410ea09362d705187a1a35ed9b7efb9676311d | |
parent | 7320748acead7eb1853c32348c7cff26d7482e58 (diff) | |
download | subsurface-b08969ac3392798b5e6ae37982b51e45d8cffaf1.tar.gz |
Dive add: fix crash when canceling
We need to reset the editMode right away, otherwise all the changes to the
input field (when resetting the data after the user cancels) will cause
Subsurface to crash as current_dive will temporarily be NULL.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | qt-ui/maintab.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index f004737af..850528192 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -792,6 +792,7 @@ void MainTab::resetPallete() void MainTab::rejectChanges() { EditMode lastMode = editMode; + editMode = NONE; tabBar()->setTabIcon(0, QIcon()); // Notes tabBar()->setTabIcon(1, QIcon()); // Equipment @@ -874,7 +875,6 @@ void MainTab::rejectChanges() MainWindow::instance()->dive_list()->setEnabled(true); notesBackup.clear(); resetPallete(); - editMode = NONE; MainWindow::instance()->globe()->reload(); if (lastMode == ADD || lastMode == MANUALLY_ADDED_DIVE) { // more clean up |