From: James Turner Date: Wed, 4 Dec 2013 09:12:37 +0000 (+0000) Subject: Reset: hook to clear the effects cache. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=26d9256ee96439cc7fe186dbb55dfb0aa19305ce;p=simgear.git Reset: hook to clear the effects cache. --- diff --git a/simgear/scene/material/Effect.hxx b/simgear/scene/material/Effect.hxx index cb4341bb..0966dc1a 100644 --- a/simgear/scene/material/Effect.hxx +++ b/simgear/scene/material/Effect.hxx @@ -176,6 +176,8 @@ Effect* makeEffect(SGPropertyNode* prop, bool makeParametersFromStateSet(SGPropertyNode* paramRoot, const osg::StateSet* ss); +void clearEffectCache(); + namespace effect { /** diff --git a/simgear/scene/material/makeEffect.cxx b/simgear/scene/material/makeEffect.cxx index 06bf47b2..4abdd4a2 100644 --- a/simgear/scene/material/makeEffect.cxx +++ b/simgear/scene/material/makeEffect.cxx @@ -270,4 +270,10 @@ Effect* makeEffect(SGPropertyNode* prop, return effect.release(); } +void clearEffectCache() +{ + OpenThreads::ScopedLock lock(effectMutex); + effectMap.clear(); +} + }