From 9d72d9f0c93555a2f902d8e9a9e7b0ca490cfd1e Mon Sep 17 00:00:00 2001 From: scrawl Date: Mon, 6 Mar 2017 16:07:03 +0100 Subject: [PATCH] Change order of operations in SceneManager::updateCache to allow deleting of StateSets that just got unreferenced by the scene --- components/resource/scenemanager.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/resource/scenemanager.cpp b/components/resource/scenemanager.cpp index 698060597..fc31b00a0 100644 --- a/components/resource/scenemanager.cpp +++ b/components/resource/scenemanager.cpp @@ -689,13 +689,13 @@ namespace Resource void SceneManager::updateCache(double referenceTime) { - mSharedStateMutex.lock(); - mSharedStateManager->prune(); - mSharedStateMutex.unlock(); - ResourceManager::updateCache(referenceTime); mInstanceCache->removeUnreferencedObjectsInCache(); + + mSharedStateMutex.lock(); + mSharedStateManager->prune(); + mSharedStateMutex.unlock(); } void SceneManager::reportStats(unsigned int frameNumber, osg::Stats *stats)