I think that you should not make an explicit delete of the _model object. The osg::reg_ptr is a smart pointer which manages the memory deletion for you. It is possible that the error is here.
Carlos On 20 March 2013 11:12, Aitor Ardanza <[email protected]> wrote: > Hi, > > I'm having complications during the transition of the diferent scenes. I want > to delete all scene and load a new one. > My code structure: > I have a class where I define a scene conponents an other things... > > Code: > > DemoOSGScene::DemoOSGScene() > { > ... > _rootGroup->addChild(_model->getRootGroup()); > _rootGroup->addChild(osgDB::readNodeFile("../../../extras/data/3d_models/scene.fbx")); > ... > } > DemoOSGScene::~DemoOSGScene(void) > { > _rootGroup->removeChildren(0,_rootGroup->getNumChildren()); > > delete _model; > } > > > > _model is a AnimatedModel object that contain osg::ref_ptr osg::Group> > m_modelRoot. > > Code: > > AnimatedModel::~AnimatedModel(void) > { > delete m_animManager; > delete m_morphManager; > delete _configReader; > > //m_modelRoot->unref(); //give me an ref_ptr Access violation error > m_modelRoot->unref_nodelete(); //works ok but memory is not liberated > } > > > > > What could be the problem? > > Thank you! > > Cheers, > Aitor > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=53168#53168 > > > > > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- -------------------------------------- Carlos Reig Matut LSyM - Instituto IRTIC Universidad de Valencia Ph. +34 96 354 3639 -- ext. 43639 http://irtic.uv.es/lsym _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

