Commit 050aa8bf authored by twanvl's avatar twanvl

Fixed crash caused by exception in SetWindow ctor

parent cbcaf5c8
...@@ -162,7 +162,17 @@ SetWindow::SetWindow(Window* parent, const SetP& set) ...@@ -162,7 +162,17 @@ SetWindow::SetWindow(Window* parent, const SetP& set)
SetExtraStyle(wxWS_EX_PROCESS_UI_UPDATES); SetExtraStyle(wxWS_EX_PROCESS_UI_UPDATES);
tabBar->SetExtraStyle(wxWS_EX_PROCESS_UI_UPDATES); tabBar->SetExtraStyle(wxWS_EX_PROCESS_UI_UPDATES);
setSet(set); try {
setSet(set);
} catch (...) {
// clean up!
// if we don't destroy the panel we could crash in ~CardsPanel, since it expected
// the insertSymbolMenu to be removed by destroyUI but not deleted.
current_panel->destroyUI(GetToolBar(), GetMenuBar());
delete find_dialog;
set_windows.erase(remove(set_windows.begin(), set_windows.end(), this));
throw;
}
current_panel->Layout(); current_panel->Layout();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment