]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/fg_init.cxx
Reset: clear the osg object cache
[flightgear.git] / src / Main / fg_init.cxx
index e9748c28cf5f610f8ebb1452ba2c02b8a98fa16a..e33c1aebdcbf8780e092967b80ff2459c0b0c626 100644 (file)
@@ -64,6 +64,7 @@
 
 #include <simgear/scene/model/modellib.hxx>
 #include <simgear/scene/material/matlib.hxx>
+#include <simgear/scene/material/Effect.hxx>
 #include <simgear/scene/model/particles.hxx>
 #include <simgear/scene/tsync/terrasync.hxx>
 
@@ -976,14 +977,19 @@ void fgStartNewReset()
     // potentially others) can queue delete requests on the pager.
     render->getViewer()->getDatabasePager()->cancel();
     
+    osgDB::Registry::instance()->clearObjectCache();
+    
     // preserve the event handler; re-creating it would entail fixing the
     // idle handler
     osg::ref_ptr<flightgear::FGEventHandler> eventHandler = render->getEventHandler();
     
     globals->set_renderer(NULL);
     globals->set_matlib(NULL);
-    simgear::SGModelLib::resetPropertyRoot();
+    globals->set_chatter_queue(NULL);
     
+    simgear::clearEffectCache();
+    simgear::SGModelLib::resetPropertyRoot();
+        
     globals->resetPropertyRoot();
     globals->restoreInitialState();