From aacdcad5297f81abe5e76c0caa31b1b9d1a27c83 Mon Sep 17 00:00:00 2001 From: fredb Date: Mon, 29 Jan 2007 08:19:13 +0000 Subject: [PATCH] restore 'double checked locking' --- simgear/scene/model/shadanim.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/simgear/scene/model/shadanim.cxx b/simgear/scene/model/shadanim.cxx index b631c7d5..60b4d3f9 100644 --- a/simgear/scene/model/shadanim.cxx +++ b/simgear/scene/model/shadanim.cxx @@ -126,7 +126,9 @@ private: static osg::TextureCubeMap* getOrCreateTextureCubeMap() { - static osg::ref_ptr textureCubeMap; + static osg::ref_ptr textureCubeMap; + if (textureCubeMap.get()) + return textureCubeMap.get(); static SGMutex mutex; SGGuard locker(mutex); -- 2.39.5