From c6a1ba7f97f5f6c8a63a9ade2ac8c42d7d529f2e Mon Sep 17 00:00:00 2001 From: mfranz Date: Tue, 8 Nov 2005 18:18:55 +0000 Subject: [PATCH] don't destroy iterated map entries; delete _menubar; restore closed non-nasal dialogs --- src/GUI/new_gui.cxx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/GUI/new_gui.cxx b/src/GUI/new_gui.cxx index d8658d3d6..339cc92a9 100644 --- a/src/GUI/new_gui.cxx +++ b/src/GUI/new_gui.cxx @@ -55,21 +55,24 @@ NewGUI::reinit () map::iterator iter; vector dlg; // close all open dialogs and remember them ... - for (iter = _active_dialogs.begin(); iter != _active_dialogs.end(); iter++) { + for (iter = _active_dialogs.begin(); iter != _active_dialogs.end(); ++iter) dlg.push_back(iter->first); - closeDialog(iter->first); - } + + unsigned int i; + for (i = 0; i < dlg.size(); i++) + closeDialog(dlg[i]); unbind(); clear(); setStyle(); + delete _menubar; _menubar = new FGMenuBar; init(); bind(); // open remembered dialogs again (no nasal generated ones, unfortunately) -// for (unsigned int i = 0; i < dlg.size(); i++) -// showDialog(dlg[i]); + for (i = 0; i < dlg.size(); i++) + showDialog(dlg[i]); } void