mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: initialize dive selection after resetting the data
The dive selection was initialized during data-reset. However, this emitted a signal before all data-reset routines were run. Ultimately, this led to access-after-free in the statistics code. Instead, move the select_newest_visible_dive() signal from the divelist-model to the process_loaded_dives() function. There is no point in initializing the selection if the dive data is cleared after all. This change broke closing of the log, because the UI-selection was not reset. Therefore, when clearing the data, clear the selection before proceeding with clearing. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
f299fa37f9
commit
a988e3c135
2 changed files with 4 additions and 2 deletions
|
@ -499,7 +499,6 @@ void DiveTripModelBase::reset()
|
|||
uiNotification(tr("finish populating data store"));
|
||||
endResetModel();
|
||||
uiNotification(tr("setting up internal data structures"));
|
||||
initSelection();
|
||||
emit diveListNotifier.numShownChanged();
|
||||
uiNotification(tr("done setting up internal data structures"));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue