Hello,
i have a seg fault because the osgText::Text::setText(std::string) is not thread-save.
It appears from type to time

Why get I this seg fault sometimes?

I have the following setup

class ObjectGroup : public osg::Group
{
...
    ObjectGroup()
   {
        ...
        text = osgText::Text;
        ....
        this->addChild(text);
        this->setUpdateCallback(new ObjectNodeCallback);
   }

//called from NodeCallback
   void updateText()
   {
         text->setText(myText);
    }

private:
    osgText::Text text;
    std::String myText;
...
};

class ObjectNodeCallback : public osg::NodeCallback
{
     //override
     operator ()(osg::Node* node, osg::NodeVisitor* nv)
     {
osg::ref_ptr<ObjectGroup> obj = dynamic_cast<ObjectGroup*>(node);
             obj->updateText();
             traverse(node, nv);
     }
};


Cheers,
David
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to