]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/main.cxx
Reset: Clear the pager queues, preserve properties.
[flightgear.git] / src / Main / main.cxx
index 26701f8a07575472645e7bcb9a65720a80b56695..f64e0d38a19de57af3a45638115f7ed9f06f61f1 100644 (file)
@@ -37,6 +37,7 @@
 #include <simgear/canvas/VGInitOperation.hxx>
 #include <simgear/scene/model/modellib.hxx>
 #include <simgear/scene/material/matlib.hxx>
+#include <simgear/scene/material/Effect.hxx>
 #include <simgear/props/AtomicChangeListener.hxx>
 #include <simgear/props/props.hxx>
 #include <simgear/timing/sg_time.hxx>
@@ -299,7 +300,9 @@ static void upper_case_property(const char *name)
         else
             assert(t == props::STRING);
     }
-    p->addChangeListener(new FGMakeUpperCase);
+    SGPropertyChangeListener* muc = new FGMakeUpperCase;
+    globals->addListenerToCleanup(muc);
+    p->addChangeListener(muc);
 }
 
 // see http://code.google.com/p/flightgear-bugs/issues/detail?id=385
@@ -388,6 +391,20 @@ int fgMainInit( int argc, char **argv ) {
         return EXIT_SUCCESS;
     }
     
+    configResult = fgInitAircraft(false);
+    if (configResult == flightgear::FG_OPTIONS_ERROR) {
+        return EXIT_FAILURE;
+    } else if (configResult == flightgear::FG_OPTIONS_EXIT) {
+        return EXIT_SUCCESS;
+    }
+    
+    configResult = flightgear::Options::sharedInstance()->processOptions();
+    if (configResult == flightgear::FG_OPTIONS_ERROR) {
+        return EXIT_FAILURE;
+    } else if (configResult == flightgear::FG_OPTIONS_EXIT) {
+        return EXIT_SUCCESS;
+    }
+    
     // Initialize the Window/Graphics environment.
     fgOSInit(&argc, argv);
     _bootstrap_OSInit++;
@@ -417,6 +434,8 @@ int fgMainInit( int argc, char **argv ) {
     frame_signal.clear();
     fgOSCloseWindow();
     
+    simgear::clearEffectCache();
+    
     // clean up here; ensure we null globals to avoid
     // confusing the atexit() handler
     delete globals;