]> 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 ba816d21f94abd64d23e94b8cc7e374d52c9eb7f..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,6 +977,8 @@ 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();
@@ -984,6 +987,7 @@ void fgStartNewReset()
     globals->set_matlib(NULL);
     globals->set_chatter_queue(NULL);
     
+    simgear::clearEffectCache();
     simgear::SGModelLib::resetPropertyRoot();
         
     globals->resetPropertyRoot();