mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
7320748ace
commit
b08969ac33
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue