Make sure wall dialog and hostage dialog close properly

When responding to EVENT_WINDOW_CLOSE, set MainWindow to nullptr - fixing multiple issues with these dialogs including the inability to re-open them and a crash on exiting the editor.
This commit is contained in:
Chris Taylor 2016-11-07 18:09:53 +08:00
parent 396f1e47f0
commit b8b19baa92
2 changed files with 2 additions and 0 deletions

View file

@ -305,6 +305,7 @@ static window_event_result hostage_dialog_handler(UI_DIALOG *dlg,const d_event &
return hostage_dialog_created(dlg, h);
case EVENT_WINDOW_CLOSE:
std::default_delete<hostage_dialog>()(h);
MainWindow = nullptr;
return window_event_result::ignored;
default:
break;

View file

@ -390,6 +390,7 @@ window_event_result wall_dialog_handler(UI_DIALOG *dlg,const d_event &event, wal
return wall_dialog_created(dlg, wd);
case EVENT_WINDOW_CLOSE:
std::default_delete<wall_dialog>()(wd);
MainWindow = nullptr;
return window_event_result::ignored;
default:
break;