mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-22 15:20:15 +02:00
Simplify two GuardedCalls into one
This commit is contained in:
parent
e08fe884e3
commit
045bedfe04
@ -349,24 +349,18 @@ void DBConnection::CheckpointThread()
|
|||||||
// Stop trying to checkpoint
|
// Stop trying to checkpoint
|
||||||
giveUp = true;
|
giveUp = true;
|
||||||
|
|
||||||
|
|
||||||
// Stop the audio.
|
// Stop the audio.
|
||||||
// OnStopAudio happens in the main thread.
|
|
||||||
GuardedCall(
|
GuardedCall(
|
||||||
[&message] {
|
[&message] {
|
||||||
throw SimpleMessageBoxException{
|
throw SimpleMessageBoxException{
|
||||||
message, XO("Warning"), "Error:_Disk_full_or_not_writable" }; },
|
message, XO("Warning"), "Error:_Disk_full_or_not_writable" }; },
|
||||||
[&](AudacityException * e) {; },
|
SimpleGuard<void>{},
|
||||||
[&](AudacityException * e) { OnStopAudio(); }
|
[&](AudacityException * e) {
|
||||||
);
|
// This executes in the main thread.
|
||||||
|
OnStopAudio();
|
||||||
// The message box in the previous GuardedCall is swallowed,
|
if (e)
|
||||||
// so send it again....
|
e->DelayedHandlerAction();
|
||||||
// Throw and catch and AudacityException, enqueuing the
|
}
|
||||||
// error message box for the event loop in the main thread
|
|
||||||
GuardedCall([&message] {
|
|
||||||
throw SimpleMessageBoxException{
|
|
||||||
message, XO("Warning"), "Error:_Disk_full_or_not_writable" }; }
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user