mirror of
https://github.com/cookiengineer/audacity
synced 2026-01-09 14:17:10 +01:00
Exception safety for Edit toolbar button presses
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user