[osg-users] Segfault when using addChild on Group object

Jannik Heller scrawl at baseoftrash.de
Fri Apr 22 17:25:07 PDT 2016


Hi,

I confirm that your example crashes. I actually reduced the code even further and still got a crash:


Code:

#include <osg/ref_ptr>
#include <osg/Group>

#include <iostream>

int main()
{
  osg::ref_ptr<osg::Group> foo = new osg::Group;
  foo->addChild(new osg::Group);

  std::cout << "foo has " << foo->getNumChildren() << " children" << std::endl;
}




Seems to be a memory corruption going on... I'm sure there's just a really silly mistake in the code but I can't spot it for the life of me.

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=66935#66935








More information about the osg-users mailing list