diff --git a/Changelog.md b/Changelog.md index 901e9a606f..fddef03a95 100644 --- a/Changelog.md +++ b/Changelog.md @@ -3,6 +3,9 @@ ### Ignition Gazebo 2.XX.XX (2020-XX-XX) +1. Fix segfault in the Breadcrumbs system + * [Pull Request 180](https://github.com/ignitionrobotics/ign-gazebo/pull/180) + 1. Added an `` element to the DiffDrive system so that a custom odometry topic can be used. * [Pull Request 179](https://github.com/ignitionrobotics/ign-gazebo/pull/179) diff --git a/src/systems/breadcrumbs/Breadcrumbs.cc b/src/systems/breadcrumbs/Breadcrumbs.cc index 26449732c7..27e4ddfbd3 100644 --- a/src/systems/breadcrumbs/Breadcrumbs.cc +++ b/src/systems/breadcrumbs/Breadcrumbs.cc @@ -245,7 +245,8 @@ void Breadcrumbs::PreUpdate(const ignition::gazebo::UpdateInfo &_info, } std::set processedEntities; - for (const auto &e : this->pendingGeometryUpdate) { + for (const auto &e : this->pendingGeometryUpdate) + { Entity perf = _ecm.EntityByComponents(components::Performer(), components::ParentEntity(e)); if (perf == kNullEntity) @@ -282,16 +283,15 @@ void Breadcrumbs::PreUpdate(const ignition::gazebo::UpdateInfo &_info, auto td = _info.simTime - it->second; if (td > this->disablePhysicsTime) { - auto nameComp = _ecm.Component(it->first); + auto name = _ecm.Component(it->first)->Data(); if (!this->MakeStatic(it->first, _ecm)) { - ignerr << "Failed to make breadcrumb '" << nameComp->Data() + ignerr << "Failed to make breadcrumb '" << name << "' static." << std::endl; } else { - ignmsg << "Breadcrumb '" << nameComp->Data() - << "' is now static." << std::endl; + ignmsg << "Breadcrumb '" << name << "' is now static." << std::endl; } this->autoStaticEntities.erase(it++); }