From 9e41e8fa7d44a49ad1154b7e36dbfa1a6b79866e Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Thu, 17 Sep 2020 22:26:25 -0400 Subject: [PATCH] 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 --- src/ProjectManager.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/ProjectManager.cpp b/src/ProjectManager.cpp index 9a7adc264..df0e74c6b 100644 --- a/src/ProjectManager.cpp +++ b/src/ProjectManager.cpp @@ -758,18 +758,17 @@ void ProjectManager::OnCloseWindow(wxCloseEvent & event) // Check validity of mTrackPanel per bug 584 Comment 1. // 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(); 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 ); // Remove self from the global array, but defer destruction of self