mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-07 20:53:25 +00:00
Cleanup: move clearing of current_dive into clear_dive_file_data()
It makes no sense to have a non-NULL current_dive once all dives have been deleted. Therefore, clear current_dive implicitly in clear_dive_file_data() and don't depend on the caller performing this. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
808316f434
commit
12c7c5ea96
2 changed files with 1 additions and 1 deletions
|
@ -1446,6 +1446,7 @@ void clear_dive_file_data()
|
||||||
{
|
{
|
||||||
while (dive_table.nr)
|
while (dive_table.nr)
|
||||||
delete_single_dive(0);
|
delete_single_dive(0);
|
||||||
|
current_dive = NULL;
|
||||||
while (dive_site_table.nr)
|
while (dive_site_table.nr)
|
||||||
delete_dive_site(get_dive_site(0, &dive_site_table), &dive_site_table);
|
delete_dive_site(get_dive_site(0, &dive_site_table), &dive_site_table);
|
||||||
if (trip_table.nr != 0) {
|
if (trip_table.nr != 0) {
|
||||||
|
|
|
@ -658,7 +658,6 @@ void MainWindow::closeCurrentFile()
|
||||||
/* free the dives and trips */
|
/* free the dives and trips */
|
||||||
clear_git_id();
|
clear_git_id();
|
||||||
clear_dive_file_data();
|
clear_dive_file_data();
|
||||||
current_dive = nullptr;
|
|
||||||
setCurrentFile(nullptr);
|
setCurrentFile(nullptr);
|
||||||
graphics->setEmptyState();
|
graphics->setEmptyState();
|
||||||
mainTab->clearTabs();
|
mainTab->clearTabs();
|
||||||
|
|
Loading…
Add table
Reference in a new issue