]> git.mxchange.org Git - simgear.git/commit
Partial fix for crash in SGPropertyNode::fireValueChanged
authorTorsten Dreyer <torsten@t3r.de>
Fri, 29 Aug 2014 13:30:25 +0000 (15:30 +0200)
committerTorsten Dreyer <torsten@t3r.de>
Fri, 29 Aug 2014 13:30:25 +0000 (15:30 +0200)
commitf33ad357e928b5210c87cb8977d3cc88deba811b
treedeac3d60ca937446445388a4eeb48687e5005c23
parentc30ce67e16d2c4287cc040294c026045aea2fbe7
Partial fix for crash in SGPropertyNode::fireValueChanged

The effect system used Listeners on property nodes to get the values
for shader uniforms. These listeners get deleted by an osg thread
causing access to freed memory when this happens while the main thread
calls fireValueChanged.

This patch changes the update method to polling for scalar properties.
This isn't 100% threadsafe, too. But at least it does not crash anymore.
simgear/scene/material/Effect.cxx
simgear/scene/material/Effect.hxx
simgear/scene/material/EffectBuilder.hxx
simgear/scene/material/EffectGeode.cxx