Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
01a99953
Commit
01a99953
authored
May 31, 2010
by
Sebastian Eichelbaum
Browse files
[FIX] clear + insert causes the freshly inserted to be removed. This is fixed now.
parent
ee989bb1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
22 deletions
+21
-22
src/graphicsEngine/WGEGroupNode.cpp
src/graphicsEngine/WGEGroupNode.cpp
+21
-22
No files found.
src/graphicsEngine/WGEGroupNode.cpp
View file @
01a99953
...
...
@@ -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
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment