mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-16 16:10:06 +02:00
Bug221 re-fixed with better exception safety: see commit 1deff18...
... in case only some tracks successfully allocate, de-allocate all before propagating the exception.
This commit is contained in:
parent
a66d7442a3
commit
2063056243
@ -1399,7 +1399,7 @@ void ControlToolBar::SetupCutPreviewTracks(double WXUNUSED(playStart), double cu
|
||||
ClearCutPreviewTracks();
|
||||
AudacityProject *p = GetActiveProject();
|
||||
if (p) {
|
||||
mCutPreviewTracks = TrackList::Create();
|
||||
auto cutPreviewTracks = TrackList::Create();
|
||||
// Find first selected track (stereo or mono) and duplicate it
|
||||
const Track *track1 = NULL, *track2 = NULL;
|
||||
TrackListIterator it(p->GetTracks());
|
||||
@ -1426,13 +1426,13 @@ void ControlToolBar::SetupCutPreviewTracks(double WXUNUSED(playStart), double cu
|
||||
}
|
||||
|
||||
// use NOTHROW-GUARANTEE:
|
||||
mCutPreviewTracks->Add(std::move(new1));
|
||||
cutPreviewTracks->Add(std::move(new1));
|
||||
if (track2)
|
||||
mCutPreviewTracks->Add(std::move(new2));
|
||||
cutPreviewTracks->Add(std::move(new2));
|
||||
}
|
||||
}
|
||||
if( !track1 )
|
||||
ClearCutPreviewTracks();
|
||||
if( track1 )
|
||||
mCutPreviewTracks = cutPreviewTracks;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user