Commit 01a99953 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[FIX] clear + insert causes the freshly inserted to be removed. This is fixed now.

parent ee989bb1
......@@ -89,28 +89,6 @@ void WGEGroupNode::SafeUpdaterCallback::operator()( osg::Node* node, osg::NodeVi
// write lock the insertion list
boost::unique_lock<boost::shared_mutex> lock;
if ( rootNode->m_insertionQueueDirty )
{
lock = boost::unique_lock<boost::shared_mutex>( rootNode->m_childInsertionQueueLock );
// insert all children which requested it
for ( std::set< osg::ref_ptr< osg::Node > >::iterator iter = rootNode->m_childInsertionQueue.begin();
iter != rootNode->m_childInsertionQueue.end();
++iter )
{
rootNode->addChild( ( *iter ) );
}
rootNode->dirtyBound();
// all children added -> clear
rootNode->m_insertionQueueDirty = false;
rootNode->m_childInsertionQueue.clear();
lock.unlock();
}
// same game for removal request list
// write lock the removal list
if ( rootNode->m_removalQueueDirty )
{
......@@ -142,6 +120,27 @@ void WGEGroupNode::SafeUpdaterCallback::operator()( osg::Node* node, osg::NodeVi
lock.unlock();
}
// same game for insertion request list
if ( rootNode->m_insertionQueueDirty )
{
lock = boost::unique_lock<boost::shared_mutex>( rootNode->m_childInsertionQueueLock );
// insert all children which requested it
for ( std::set< osg::ref_ptr< osg::Node > >::iterator iter = rootNode->m_childInsertionQueue.begin();
iter != rootNode->m_childInsertionQueue.end();
++iter )
{
rootNode->addChild( ( *iter ) );
}
rootNode->dirtyBound();
// all children added -> clear
rootNode->m_insertionQueueDirty = false;
rootNode->m_childInsertionQueue.clear();
lock.unlock();
}
// forward the call
traverse( node, nv );
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment