1
0
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:
Paul Licameli 2016-11-27 10:08:57 -05:00
parent 664974d3ff
commit 40aa70a255

View File

@ -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()