Skip to content

Commit

Permalink
Merge pull request #926 from arntanguy/fix-tf
Browse files Browse the repository at this point in the history
Fix #911 #616 : TF Segfaults on reset/update
  • Loading branch information
wjwwood committed Oct 9, 2015
2 parents 4abbbd9 + 606fe02 commit 4e0af42
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions src/rviz/default_plugin/tf_display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -570,14 +570,17 @@ void TFDisplay::updateFrame( FrameInfo* frame )
{
FrameInfo* parent = parent_it->second;

// Delete the old tree property.
delete frame->tree_property_;
frame->tree_property_ = NULL;

// If the parent has a tree property, make a new tree property for this frame.
if( parent->tree_property_ )
{
frame->tree_property_ = new Property( QString::fromStdString( frame->name_ ), QVariant(), "", parent->tree_property_ );
if(!frame->tree_property_) {
frame->tree_property_ = new Property( QString::fromStdString( frame->name_ ), QVariant(), "", parent->tree_property_ );
} else {
frame->tree_property_->setParent(parent->tree_property_);
frame->tree_property_->setName(QString::fromStdString( frame->name_ ));
frame->tree_property_->setValue(QVariant());
frame->tree_property_->setDescription("");
}
}
}
}
Expand Down Expand Up @@ -641,8 +644,14 @@ void TFDisplay::updateFrame( FrameInfo* frame )
{
if ( !frame->tree_property_ || old_parent != frame->parent_ )
{
delete frame->tree_property_;
frame->tree_property_ = new Property( QString::fromStdString( frame->name_ ), QVariant(), "", tree_category_ );
if(!frame->tree_property_) {
frame->tree_property_ = new Property( QString::fromStdString( frame->name_ ), QVariant(), "", tree_category_ );
} else {
frame->tree_property_->setName(QString::fromStdString( frame->name_ ));
frame->tree_property_->setValue(QVariant());
frame->tree_property_->setDescription("");
frame->tree_property_->setParent(tree_category_);
}
}

frame->parent_arrow_->getSceneNode()->setVisible( false );
Expand Down

0 comments on commit 4e0af42

Please sign in to comment.