diff --git a/src/osgDB/DatabasePager.cpp b/src/osgDB/DatabasePager.cpp index 4612a5e1a..6ff04caa5 100644 --- a/src/osgDB/DatabasePager.cpp +++ b/src/osgDB/DatabasePager.cpp @@ -537,6 +537,10 @@ void DatabasePager::removeExpiredSubgraphs(double currentFrameTime) _childrenToDeleteListMutex.unlock(); } // otherwise the childrenRemoved list will automatically unref() and deleting the nodes. + + // update the Registry object cache. + osgDB::Registry::instance()->updateTimeStampOfObjectsInCacheWithExtenalReferences(currentFrameTime); + osgDB::Registry::instance()->removeExpiredObjectsInCache(expiryTime); } diff --git a/src/osgDB/Registry.cpp b/src/osgDB/Registry.cpp index fbfc3b34c..3cfef076f 100644 --- a/src/osgDB/Registry.cpp +++ b/src/osgDB/Registry.cpp @@ -1813,8 +1813,7 @@ void Registry::removeExpiredObjectsInCache(double expiryTime) oitr!=_objectCache.end(); ++oitr) { - if (oitr->second.second<=expiryTime && - oitr->second.first->referenceCount()<=1) + if (oitr->second.second<=expiryTime) { // record the filename of the entry to use as key for deleting // afterwards/