From 093f5aef5e2f1a729d7fecf13de32d8ffbac4f34 Mon Sep 17 00:00:00 2001 From: Levi Armstrong Date: Sun, 17 Nov 2024 14:40:35 -0600 Subject: [PATCH] Fix environment clear such that cache is cleared before plugin factories are destroyed --- tesseract_environment/src/environment.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tesseract_environment/src/environment.cpp b/tesseract_environment/src/environment.cpp index abec75d201b..bbf055b124e 100644 --- a/tesseract_environment/src/environment.cpp +++ b/tesseract_environment/src/environment.cpp @@ -612,8 +612,6 @@ void Environment::Implementation::clear() collision_margin_data = tesseract_collision::CollisionMarginData(); kinematics_information.clear(); contact_managers_plugin_info.clear(); - kinematics_factory = tesseract_kinematics::KinematicsPluginFactory(); - contact_managers_factory = tesseract_collision::ContactManagersPluginFactory(); { std::unique_lock lock(discrete_manager_mutex); @@ -639,6 +637,10 @@ void Environment::Implementation::clear() std::unique_lock lock(kinematic_group_cache_mutex); kinematic_group_cache.clear(); } + + // Must clear cache before deleting plugin factories + kinematics_factory = tesseract_kinematics::KinematicsPluginFactory(); + contact_managers_factory = tesseract_collision::ContactManagersPluginFactory(); } bool Environment::Implementation::reset()