From 48216e9d531ead927716f823caf8eba2abb4ff58 Mon Sep 17 00:00:00 2001 From: "Addisu Z. Taddese" Date: Thu, 16 Feb 2023 13:39:50 -0600 Subject: [PATCH] Fix memory corruption due to faulty refcount tracking (#480) The memory corruption seems to occur only on DART 6.9.2 (version that comes with Ubuntu 20.04), but not 6.12 (Ubuntu 22.04), so I'm led to believe it's a bug in dart that has since been fixed. But the patch in this PR seems to avoid the problem by not storing the freejoint created when creating links. My suspicion is that this freejoint is not properly taken into account when removing skeletons. Signed-off-by: Addisu Z. Taddese --- dartsim/src/SDFFeatures.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/dartsim/src/SDFFeatures.cc b/dartsim/src/SDFFeatures.cc index 9bdab461b..74ca33bb3 100644 --- a/dartsim/src/SDFFeatures.cc +++ b/dartsim/src/SDFFeatures.cc @@ -633,7 +633,6 @@ Identity SDFFeatures::ConstructSdfLink( world->getName(), ::sdf::JoinName(modelInfo.model->getName(), bn->getName())); const std::size_t linkID = this->AddLink(bn, fullName, _modelID, sdfInertia); - this->AddJoint(joint); auto linkIdentity = this->GenerateIdentity(linkID, this->links.at(linkID));