diff --git a/components/resource/scenemanager.cpp b/components/resource/scenemanager.cpp index c2be3960f..eecee813f 100644 --- a/components/resource/scenemanager.cpp +++ b/components/resource/scenemanager.cpp @@ -357,7 +357,9 @@ namespace Resource loaded->accept(setFilterSettingsControllerVisitor); // share state + mSharedStateMutex.lock(); osgDB::Registry::instance()->getOrCreateSharedStateManager()->share(loaded.get()); + mSharedStateMutex.unlock(); if (mIncrementalCompileOperation) mIncrementalCompileOperation->add(loaded); diff --git a/components/resource/scenemanager.hpp b/components/resource/scenemanager.hpp index 173131e66..0345fff22 100644 --- a/components/resource/scenemanager.hpp +++ b/components/resource/scenemanager.hpp @@ -89,6 +89,8 @@ namespace Resource void setUnRefImageDataAfterApply(bool unref); private: + OpenThreads::Mutex mSharedStateMutex; + Resource::ImageManager* mImageManager; Resource::NifFileManager* mNifFileManager;