Revision: 8599 http://playerstage.svn.sourceforge.net/playerstage/?rev=8599&view=rev Author: hsujohnhsu Date: 2010-03-24 01:52:27 +0000 (Wed, 24 Mar 2010)
Log Message: ----------- this destructor seems more stable. Modified Paths: -------------- code/gazebo/trunk/server/rendering/OgreVisual.cc Modified: code/gazebo/trunk/server/rendering/OgreVisual.cc =================================================================== --- code/gazebo/trunk/server/rendering/OgreVisual.cc 2010-03-22 21:59:24 UTC (rev 8598) +++ code/gazebo/trunk/server/rendering/OgreVisual.cc 2010-03-24 01:52:27 UTC (rev 8599) @@ -160,27 +160,29 @@ delete this->materialNameP; delete this->castShadowsP; + RTShaderSystem::Instance()->DetachEntity(this); + // Having this chunk of code causes a segfault when closing the // application. - /*if (this->parentNode && this->sceneNode) + if (this->parentNode != NULL) { - this->parentNode->removeChild( this->sceneNode ); + if (this->sceneNode != NULL) + { + if (this->boundingBoxNode != NULL) + { + this->sceneNode->removeAndDestroyChild( this->boundingBoxNode->getName() ); + } + this->parentNode->removeAndDestroyChild( this->sceneNode->getName() ); + } } - this->sceneNode->removeAndDestroyAllChildren(); - */ + //is below equivalent? + //this->sceneNode->removeAndDestroyAllChildren(); + //if (this->sceneNode) + // OgreAdaptor::Instance()->sceneMgr->destroySceneNode(this->sceneNode); + //if (this->boundingBoxNode) + // OgreAdaptor::Instance()->sceneMgr->destroySceneNode(this->boundingBoxNode); - RTShaderSystem::Instance()->DetachEntity(this); - - if (this->sceneNode) - { - OgreAdaptor::Instance()->sceneMgr->destroySceneNode(this->sceneNode); - } - if (this->boundingBoxNode) - { - OgreAdaptor::Instance()->sceneMgr->destroySceneNode(this->boundingBoxNode); - } - } //////////////////////////////////////////////////////////////////////////////// This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Playerstage-commit mailing list Playerstage-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/playerstage-commit