Added more comprehensive releaseGLObjects(State*=0) throughout Nodes,
Drawables,StateSet, and osgDB::Registry. Added cleanup_frame() from to osgProducer::OsgCamerGroup to help with proper clean of OpenGL objects before exit, and modified osgviewer, osghangglider, osgwindows examples to do the extra frame call to cleanup_frame() before exit.
This commit is contained in:
@@ -1787,6 +1787,19 @@ void Registry::clearArchiveCache()
|
||||
_archiveCache.clear();
|
||||
}
|
||||
|
||||
void Registry::releaseGLObjects(osg::State* state)
|
||||
{
|
||||
OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_objectCacheMutex);
|
||||
|
||||
for(ObjectCache::iterator itr = _objectCache.begin();
|
||||
itr != _objectCache.end();
|
||||
++itr)
|
||||
{
|
||||
osg::Object* object = itr->second.first.get();
|
||||
object->releaseGLObjects(state);
|
||||
}
|
||||
}
|
||||
|
||||
DatabasePager* Registry::getOrCreateDatabasePager()
|
||||
{
|
||||
if (!_databasePager) _databasePager = new DatabasePager;
|
||||
|
||||
Reference in New Issue
Block a user