Snippets

Steve Peters Fix pr2 segfaults in gazebo pull request 2201

Created by Steve Peters
diff -r 6af1dc1019b2 gazebo/rendering/Projector.cc
--- a/gazebo/rendering/Projector.cc	Wed Mar 23 14:13:32 2016 -0700
+++ b/gazebo/rendering/Projector.cc	Wed Mar 23 15:41:55 2016 -0700
@@ -205,6 +205,13 @@
 {
   this->RemovePassFromMaterials();
 
+  if (this->filterNode)
+  {
+    this->filterNode->detachObject(this->filterFrustum);
+    this->node->removeAndDestroyChild(this->filterNodeName);
+    this->filterNode = NULL;
+  }
+
   if (this->node)
   {
     this->node->detachObject(this->frustum);
@@ -212,13 +219,6 @@
     this->node = NULL;
   }
 
-  if (this->filterNode)
-  {
-    this->filterNode->detachObject(this->filterFrustum);
-    this->visual->GetSceneNode()->removeAndDestroyChild(this->filterNodeName);
-    this->filterNode = NULL;
-  }
-
   delete this->frustum;
   delete this->filterFrustum;
   this->frustum = NULL;
@@ -300,7 +300,7 @@
   if (this->filterNode)
   {
     this->filterNode->detachObject(this->filterFrustum);
-    this->visual->GetSceneNode()->removeAndDestroyChild(this->filterNodeName);
+    this->node->removeAndDestroyChild(this->filterNodeName);
     this->filterNode = NULL;
   }
 

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.