1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-14 17:14:07 +01:00

Bug2127: Record, Pause, Record, Pause, Close button: shouldn't crash

This commit is contained in:
Paul Licameli
2019-06-28 09:25:44 -04:00
parent 6aba4a3fc7
commit c50acea328
3 changed files with 9 additions and 2 deletions

View File

@@ -154,10 +154,11 @@ UIHandle::Result CloseButtonHandle::CommitChanges
auto pTrack = mpTrack.lock();
if (pTrack)
{
auto toRemove = pTrack->SubstitutePendingChangedTrack();
TransportActions::StopIfPaused( *pProject );
if (!ProjectAudioIO::Get( *pProject ).IsAudioActive()) {
// This pushes an undo item:
TrackUtilities::DoRemoveTrack(*pProject, pTrack.get());
TrackUtilities::DoRemoveTrack(*pProject, toRemove.get());
// Redraw all tracks when any one of them closes
// (Could we invent a return code that draws only those at or below
// the affected track?)