From bf9af3f94014c8155b1a7764fdac381133aa8dd0 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 2 Jan 2004 17:06:18 +0000 Subject: [PATCH] Added "&& oitr->second.first->referenceCount()<=1" check to removeExpiredObjectsInCache so that it only expires objects in the cache that have no external reference. --- src/osgDB/Registry.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/osgDB/Registry.cpp b/src/osgDB/Registry.cpp index 3cfef076f..fbfc3b34c 100644 --- a/src/osgDB/Registry.cpp +++ b/src/osgDB/Registry.cpp @@ -1813,7 +1813,8 @@ void Registry::removeExpiredObjectsInCache(double expiryTime) oitr!=_objectCache.end(); ++oitr) { - if (oitr->second.second<=expiryTime) + if (oitr->second.second<=expiryTime && + oitr->second.first->referenceCount()<=1) { // record the filename of the entry to use as key for deleting // afterwards/