1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-23 17:30:17 +01: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. // Rememebr the old blocksize, so that we can restore it later.
auto oldBlockSize = Sequence::GetMaxDiskBlockSize(); auto oldBlockSize = Sequence::GetMaxDiskBlockSize();
const auto cleanup = finally([=]
{ Sequence::SetMaxDiskBlockSize(oldBlockSize); }
);
Sequence::SetMaxDiskBlockSize(blockSize * 1024); Sequence::SetMaxDiskBlockSize(blockSize * 1024);
wxBusyCursor busy; wxBusyCursor busy;
@@ -535,7 +538,6 @@ void BenchmarkDialog::OnRun( wxCommandEvent & WXUNUSED(event))
dd.reset(); dd.reset();
Sequence::SetMaxDiskBlockSize(oldBlockSize);
Printf(wxT("Benchmark completed successfully.\n")); Printf(wxT("Benchmark completed successfully.\n"));
HoldPrint(false); HoldPrint(false);