diff --git a/bullet-featherstone/src/Base.hh b/bullet-featherstone/src/Base.hh index 5c84043ae..e16d2fb43 100644 --- a/bullet-featherstone/src/Base.hh +++ b/bullet-featherstone/src/Base.hh @@ -358,8 +358,11 @@ class Base : public Implements3d> } public: ~Base() override { - this->triangleMeshes.clear(); + // The order of destruction between meshesGImpact and triangleMeshes is + // important. this->meshesGImpact.clear(); + this->triangleMeshes.clear(); + this->joints.clear(); for (auto [k, link] : links)