Hi,
Adding a child is perfectly safe under normal circumstances, if you
are getting an access violation that perhaps you are trying to operate
of a object that has been deleted. The OSG has ref counting which
prevents these problems, but if you don't keep ref_ptr<> to global
objects then you want have this safety, objects can get deleted from
underneath you.
Another thing to watch is making sure that you don't add or remove
children which traversing the scene graph as this will invalidate
iterators.
Robert.
On 11/2/06, xiaoshuxing <[EMAIL PROTECTED]> wrote:
This is not the first time I've encountered such problem.
What I've done is just adding a child to a group as following.
Most of the time, it's so easy to add a child, but there were times this
went wrong.
it compiles OK, but got an "Access violation" error when running.
osg::ref_ptr<osg::BillBoard> b = new osg::BillBoard
chain->addChild(b.get());
and the top of the call stack is:
explicit ScopedLock(M& m):m_lock(m) {m_lock.lock();}
I've tried whatever I can do, but nothing worked
I must have overlooked something, but I just can't find it out.
It'll be so grate if I can figure out this problem.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/