mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Fixed crash caused by exception in SetWindow ctor
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1019 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
+11
-1
@@ -162,7 +162,17 @@ SetWindow::SetWindow(Window* parent, const SetP& set)
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user