diff --git a/include/osg/TexGenNode b/include/osg/TexGenNode index 51c44227a..8f33afb3e 100644 --- a/include/osg/TexGenNode +++ b/include/osg/TexGenNode @@ -60,6 +60,8 @@ class OSG_EXPORT TexGenNode : public Group /** Get the const TexGen. */ inline const TexGen* getTexGen() const { return _texgen.get(); } + /** Set whether to use a mutex to ensure ref() and unref() are thread safe.*/ + virtual void setThreadSafeRefUnref(bool threadSafe); protected: diff --git a/src/osg/TexGenNode.cpp b/src/osg/TexGenNode.cpp index e10ad5d3f..05c4ee4bf 100644 --- a/src/osg/TexGenNode.cpp +++ b/src/osg/TexGenNode.cpp @@ -56,3 +56,11 @@ void TexGenNode::setTexGen(TexGen* texgen) { _texgen = texgen; } + + +void TexGenNode::setThreadSafeRefUnref(bool threadSafe) +{ + Group::setThreadSafeRefUnref(threadSafe); + + if (_texgen.valid()) _texgen->setThreadSafeRefUnref(threadSafe); +}