Skip to content

Commit

Permalink
Fix #1825
Browse files Browse the repository at this point in the history
model_ is destroyed between registration of the single-shot timer and its execution
  • Loading branch information
rhaschke committed May 9, 2024
1 parent b0ca390 commit e0ec5f6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/rviz/properties/property.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,10 @@ void Property::setModel(PropertyTreeModel* model)
if (model_ && hidden_)
{
// process propertyHiddenChanged after insertion into model has finished
QTimer::singleShot(0, model_, [this]() { model_->emitPropertyHiddenChanged(this); });
QTimer::singleShot(0, model_, [this]() {
if (model_)
model_->emitPropertyHiddenChanged(this);
});
}
int num_children = numChildren();
for (int i = 0; i < num_children; i++)
Expand Down

0 comments on commit e0ec5f6

Please sign in to comment.