Skip to content

Commit

Permalink
Only tear down objects if they've been created #1163 (#1164)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasw authored and wjwwood committed Oct 20, 2017
1 parent 150c894 commit fa59398
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/rviz/default_plugin/markers/triangle_list_marker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,12 @@ TriangleListMarker::TriangleListMarker(MarkerDisplay* owner, DisplayContext* con

TriangleListMarker::~TriangleListMarker()
{
context_->getSceneManager()->destroyManualObject(manual_object_);
material_->unload();
Ogre::MaterialManager::getSingleton().remove(material_->getName());
if (manual_object_)
{
context_->getSceneManager()->destroyManualObject(manual_object_);
material_->unload();
Ogre::MaterialManager::getSingleton().remove(material_->getName());
}
}

void TriangleListMarker::onNewMessage(const MarkerConstPtr& old_message, const MarkerConstPtr& new_message)
Expand Down

0 comments on commit fa59398

Please sign in to comment.