From: fredb Date: Mon, 29 Jan 2007 08:19:13 +0000 (+0000) Subject: restore 'double checked locking' X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=aacdcad5297f81abe5e76c0caa31b1b9d1a27c83;p=simgear.git restore 'double checked locking' --- 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);