1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-04-30 07:39:42 +02:00

Now cure the error dialogs alluded to in past commit

This commit is contained in:
Paul Licameli 2020-09-14 15:16:54 -04:00
parent cbd21c5fff
commit 1d8cbf2798

View File

@ -748,9 +748,6 @@ void ProjectManager::OnCloseWindow(wxCloseEvent & event)
tracks.Clear();
}
// We're all done with the project file, so close it now
projectFileManager.CloseProject();
// Some of the AdornedRulerPanel functions refer to the TrackPanel, so destroy this
// before the TrackPanel is destroyed. This change was needed to stop Audacity
// crashing when running with Jaws on Windows 10 1703.
@ -762,6 +759,11 @@ void ProjectManager::OnCloseWindow(wxCloseEvent & event)
// Deeper fix is in the Import code, but this failsafes against crash.
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
// to save the state of the toolbars.
ToolManager::Get( project ).Destroy();