1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-16 08:34:10 +02:00

Destroy the project history window before either the Track Panel or the Toolbars, as the destruction of the History Window may result in events being sent to the latter two (esp. on Mac). If the events are sent to things we have destroyed, then we get crashes ...

Patch by Leland
This commit is contained in:
richardash1981 2011-12-22 22:41:17 +00:00
parent affcec50e4
commit e1724c8609

View File

@ -1949,6 +1949,16 @@ void AudacityProject::OnCloseWindow(wxCloseEvent & event)
mLastSavedTracks = NULL;
}
// Get rid of the history window
// LL: Destroy it before the TrackPanel and ToolBars since they
// may/will get additional wxEVT_PAINT events since window
// destruction may be queued. This seems to only be a problem
// on the Mac.
if (mHistoryWindow) {
mHistoryWindow->Destroy();
mHistoryWindow = NULL;
}
// Destroy the TrackPanel early so it's not around once we start
// deleting things like tracks and such out from underneath it.
mTrackPanel->Destroy();
@ -1959,12 +1969,6 @@ void AudacityProject::OnCloseWindow(wxCloseEvent & event)
delete mToolManager;
mToolManager = NULL;
// Get rid of the history window
if (mHistoryWindow) {
mHistoryWindow->Destroy();
mHistoryWindow = NULL;
}
DestroyChildren();
delete mTrackFactory;