mirror of
https://github.com/cookiengineer/audacity
synced 2025-09-18 00:50:52 +02:00
Exception safety for Edit toolbar button presses
This commit is contained in:
parent
664974d3ff
commit
40aa70a255
@ -243,6 +243,10 @@ void EditToolBar::OnButton(wxCommandEvent &event)
|
||||
int id = event.GetId();
|
||||
// FIXME: Some "SelectAllIfNone()" do not work as expected
|
||||
// due to bugs elsewhere (see: AudacityProject::UpdateMenus() )
|
||||
|
||||
// Be sure the pop-up happens even if there are exceptions
|
||||
auto cleanup = finally( [&] { SetButton(false, mButtons[id]); } );
|
||||
|
||||
switch (id) {
|
||||
case ETBCutID:
|
||||
p->SelectAllIfNone();
|
||||
@ -299,8 +303,6 @@ void EditToolBar::OnButton(wxCommandEvent &event)
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
SetButton(false, mButtons[id]);
|
||||
}
|
||||
|
||||
void EditToolBar::EnableDisableButtons()
|
||||
|
Loading…
x
Reference in New Issue
Block a user