From f21a70a4e748a1ef67d8c4181facaa4a8f2c57e3 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 26 Jan 2004 14:51:01 +0000 Subject: [PATCH] Set the delete of expired subgraphs in the database thread to false, to prevent problems with osgText. Will need to solve the dirtyTextureObject issue. --- src/osgDB/DatabasePager.cpp | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/osgDB/DatabasePager.cpp b/src/osgDB/DatabasePager.cpp index 5b3811adf..8038dd755 100644 --- a/src/osgDB/DatabasePager.cpp +++ b/src/osgDB/DatabasePager.cpp @@ -27,7 +27,7 @@ DatabasePager::DatabasePager() _threadPriorityDuringFrame = PRIORITY_MIN; _threadPriorityOutwithFrame = PRIORITY_NOMINAL; - _deleteRemovedSubgraphsInDatabaseThread = true; + _deleteRemovedSubgraphsInDatabaseThread = false;//true; _expiryDelay = 1.0; @@ -550,19 +550,6 @@ void DatabasePager::removeExpiredSubgraphs(double currentFrameTime) //osg::notify(osg::INFO)<<" PagedLOD "<referenceCount()<accept(rtadv); - } - } - if (osgDB::Registry::instance()->getSharedStateManager()) osgDB::Registry::instance()->getSharedStateManager()->prune(); @@ -570,6 +557,16 @@ void DatabasePager::removeExpiredSubgraphs(double currentFrameTime) if (_deleteRemovedSubgraphsInDatabaseThread) { + // for all the subgraphs to remove find all the textures and drawables and + // strip them from the display lists. + ReleaseTexturesAndDrawablesVisitor rtadv; + for(osg::NodeList::iterator nitr=childrenRemoved.begin(); + nitr!=childrenRemoved.end(); + ++nitr) + { + (*nitr)->accept(rtadv); + } + // transfer the removed children over to the to delete list so the database thread can delete them. _childrenToDeleteListMutex.lock(); _childrenToDeleteList.insert(_childrenToDeleteList.begin(),childrenRemoved.begin(),childrenRemoved.end());