Fix non threadsafe code

This commit is contained in:
fredb 2008-06-01 17:25:05 +00:00
parent c6b03555f7
commit 1a498348ee

View File

@ -44,14 +44,14 @@ SGSceneFeatures::SGSceneFeatures() :
{
}
static SGMutex mutexSGSceneFeatures_instance;
SGSceneFeatures*
SGSceneFeatures::instance()
{
static SGSharedPtr<SGSceneFeatures> sceneFeatures;
if (sceneFeatures)
return sceneFeatures;
static SGMutex mutex;
SGGuard<SGMutex> guard(mutex);
SGGuard<SGMutex> guard(mutexSGSceneFeatures_instance);
if (sceneFeatures)
return sceneFeatures;
sceneFeatures = new SGSceneFeatures;