]> git.mxchange.org Git - flightgear.git/blobdiff - src/GUI/new_gui.cxx
Boris Koenig:
[flightgear.git] / src / GUI / new_gui.cxx
index 8a3a12f3c9bd120f683ef1ac72c66d0844853578..65bdd9add93196f0879de33b6a5cae9baae0917f 100644 (file)
@@ -69,7 +69,9 @@ NewGUI::unbind ()
 void
 NewGUI::update (double delta_time_sec)
 {
-    // NO OP
+    map<string,FGDialog *>::iterator iter = _active_dialogs.begin();
+    for(/**/; iter != _active_dialogs.end(); iter++)
+        iter->second->update();
 }
 
 bool
@@ -95,9 +97,13 @@ NewGUI::closeActiveDialog ()
     // algorithm to do (delete map entries by value, not key)?  I hate
     // the STL :) -Andy
     map<string,FGDialog *>::iterator iter = _active_dialogs.begin();
-    for(/**/; iter != _active_dialogs.end(); iter++)
-        if(iter->second == _active_dialog)
+    for(/**/; iter != _active_dialogs.end(); iter++) {
+        if(iter->second == _active_dialog) {
             _active_dialogs.erase(iter);
+            // iter is no longer valid
+            break;
+        }
+    }
 
     delete _active_dialog;
     _active_dialog = 0;
@@ -206,7 +212,7 @@ NewGUI::readDir (const char * path)
             SGPropertyNode * props = new SGPropertyNode;
             try {
                 readProperties(subpath, props);
-            } catch (const sg_exception &ex) {
+            } catch (const sg_exception &) {
                 SG_LOG(SG_INPUT, SG_ALERT, "Error parsing dialog "
                        << subpath);
                 delete props;