Changeset 10520 for OpenSceneGraph/trunk/src/osgDB/Registry.cpp
- Timestamp:
- 08/05/09 13:06:53 (4 years ago)
- Files:
-
- 1 modified
-
OpenSceneGraph/trunk/src/osgDB/Registry.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgDB/Registry.cpp
r10356 r10520 186 186 if (switchOff) _buildKdTreesHint = Options::DO_NOT_BUILD_KDTREES; 187 187 else _buildKdTreesHint = Options::BUILD_KDTREES; 188 } 189 190 const char* ptr=0; 191 192 _expiryDelay = 10.0; 193 if( (ptr = getenv("OSG_EXPIRY_DELAY")) != 0) 194 { 195 _expiryDelay = osg::asciiToDouble(ptr); 196 osg::notify(osg::INFO)<<"Registry : Expiry delay = "<<_expiryDelay<<std::endl; 188 197 } 189 198 … … 2105 2114 } 2106 2115 2107 void Registry::updateTimeStampOfObjectsInCacheWithExternalReferences( double currentTime)2116 void Registry::updateTimeStampOfObjectsInCacheWithExternalReferences(const osg::FrameStamp& frameStamp) 2108 2117 { 2109 2118 OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_objectCacheMutex); … … 2118 2127 { 2119 2128 // so update it time stamp. 2120 itr->second.second = currentTime; 2121 } 2122 } 2123 } 2124 2125 void Registry::removeExpiredObjectsInCache(double expiryTime) 2126 { 2129 itr->second.second = frameStamp.getReferenceTime(); 2130 } 2131 } 2132 } 2133 2134 void Registry::removeExpiredObjectsInCache(const osg::FrameStamp& frameStamp) 2135 { 2136 double expiryTime = frameStamp.getReferenceTime() - _expiryDelay; 2137 2127 2138 OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_objectCacheMutex); 2128 2139
