1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-15 15:49:36 +02:00

Delay closing of databse at close some more...

... So that you don't get an error message, when you close a project without
saving changes, with the mixer board open
This commit is contained in:
Paul Licameli 2020-09-17 22:26:25 -04:00
parent 1d8cbf2798
commit 9e41e8fa7d

View File

@ -758,18 +758,17 @@ void ProjectManager::OnCloseWindow(wxCloseEvent & event)
// Check validity of mTrackPanel per bug 584 Comment 1. // Check validity of mTrackPanel per bug 584 Comment 1.
// Deeper fix is in the Import code, but this failsafes against crash. // Deeper fix is in the Import code, but this failsafes against crash.
TrackPanel::Destroy( project ); TrackPanel::Destroy( project );
// Close project only now, because TrackPanel might have been holding
// some shared_ptr to WaveTracks keeping SampleBlocks alive.
// We're all done with the project file, so close it now
projectFileManager.CloseProject();
// Finalize the tool manager before the children since it needs // Finalize the tool manager before the children since it needs
// to save the state of the toolbars. // to save the state of the toolbars.
ToolManager::Get( project ).Destroy(); ToolManager::Get( project ).Destroy();
window.DestroyChildren(); window.DestroyChildren();
// Close project only now, because TrackPanel might have been holding
// some shared_ptr to WaveTracks keeping SampleBlocks alive.
// We're all done with the project file, so close it now
projectFileManager.CloseProject();
WaveTrackFactory::Destroy( project ); WaveTrackFactory::Destroy( project );
// Remove self from the global array, but defer destruction of self // Remove self from the global array, but defer destruction of self