From 26d9256ee96439cc7fe186dbb55dfb0aa19305ce Mon Sep 17 00:00:00 2001 From: James Turner Date: Wed, 4 Dec 2013 09:12:37 +0000 Subject: [PATCH] Reset: hook to clear the effects cache. --- simgear/scene/material/Effect.hxx | 2 ++ simgear/scene/material/makeEffect.cxx | 6 ++++++ 2 files changed, 8 insertions(+) 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(); +} + }