]> git.mxchange.org Git - simgear.git/commitdiff
Reset: hook to clear the effects cache.
authorJames Turner <zakalawe@mac.com>
Wed, 4 Dec 2013 09:12:37 +0000 (09:12 +0000)
committerJames Turner <zakalawe@mac.com>
Wed, 4 Dec 2013 09:12:51 +0000 (09:12 +0000)
simgear/scene/material/Effect.hxx
simgear/scene/material/makeEffect.cxx

index cb4341bb4d8e2c7db5023f0171724bcc592ec7d9..0966dc1aa63e8b7d9bcba911b90e44af12cf4f64 100644 (file)
@@ -176,6 +176,8 @@ Effect* makeEffect(SGPropertyNode* prop,
 bool makeParametersFromStateSet(SGPropertyNode* paramRoot,
                                 const osg::StateSet* ss);
 
+void clearEffectCache();
+
 namespace effect
 {
 /**
index 06bf47b229b1d8d118816f85a3c60a2f63e41e53..4abdd4a2da2034e598933ad52453c0234b7669e6 100644 (file)
@@ -270,4 +270,10 @@ Effect* makeEffect(SGPropertyNode* prop,
     return effect.release();
 }
 
+void clearEffectCache()
+{
+    OpenThreads::ScopedLock<OpenThreads::ReentrantMutex> lock(effectMutex);
+    effectMap.clear();
+}
+
 }