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:
parent
3704dd0eeb
commit
96242ef2df
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user