1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-04-30 15:49:41 +02:00

Undo a global effect with RAII

This commit is contained in:
Paul Licameli 2016-09-01 13:15:29 -04:00
parent 3704dd0eeb
commit 96242ef2df

View File

@ -336,6 +336,9 @@ void BenchmarkDialog::OnRun( wxCommandEvent & WXUNUSED(event))
// Rememebr the old blocksize, so that we can restore it later.
auto oldBlockSize = Sequence::GetMaxDiskBlockSize();
const auto cleanup = finally([=]
{ Sequence::SetMaxDiskBlockSize(oldBlockSize); }
);
Sequence::SetMaxDiskBlockSize(blockSize * 1024);
wxBusyCursor busy;
@ -535,7 +538,6 @@ void BenchmarkDialog::OnRun( wxCommandEvent & WXUNUSED(event))
dd.reset();
Sequence::SetMaxDiskBlockSize(oldBlockSize);
Printf(wxT("Benchmark completed successfully.\n"));
HoldPrint(false);