mirror of
https://github.com/cookiengineer/audacity
synced 2025-09-18 09:00:52 +02:00
Bug1871: Make Effect::Preview cleanup sequence as was before 79c3bef
This commit is contained in:
parent
59cb9be780
commit
56c42e870e
@ -2515,6 +2515,18 @@ void Effect::Preview(bool dryOnly)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
bool success = true;
|
bool success = true;
|
||||||
|
|
||||||
|
auto cleanup = finally( [&] {
|
||||||
|
|
||||||
|
// Effect is already inited; we will call Process, End, and then Init
|
||||||
|
// again, so the state is exactly the way it was before Preview
|
||||||
|
// was called.
|
||||||
|
if (!dryOnly) {
|
||||||
|
End();
|
||||||
|
GuardedCall( [&]{ Init(); } );
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
|
||||||
auto vr0 = valueRestorer( mT0 );
|
auto vr0 = valueRestorer( mT0 );
|
||||||
auto vr1 = valueRestorer( mT1 );
|
auto vr1 = valueRestorer( mT1 );
|
||||||
// Most effects should stop at t1.
|
// Most effects should stop at t1.
|
||||||
@ -2524,17 +2536,8 @@ void Effect::Preview(bool dryOnly)
|
|||||||
// Save the original track list
|
// Save the original track list
|
||||||
TrackList *saveTracks = mTracks;
|
TrackList *saveTracks = mTracks;
|
||||||
|
|
||||||
auto cleanup = finally( [&] {
|
auto cleanup2 = finally( [&] {
|
||||||
mTracks = saveTracks;
|
mTracks = saveTracks;
|
||||||
|
|
||||||
// Effect is already inited; we will call Process, End, and then Init
|
|
||||||
// again, so the state is exactly the way it was before Preview
|
|
||||||
// was called.
|
|
||||||
if (!dryOnly) {
|
|
||||||
End();
|
|
||||||
GuardedCall( [&]{ Init(); } );
|
|
||||||
}
|
|
||||||
|
|
||||||
if (FocusDialog) {
|
if (FocusDialog) {
|
||||||
FocusDialog->SetFocus();
|
FocusDialog->SetFocus();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user