From d85025c502eee286fa67acf41480176c16cc7f23 Mon Sep 17 00:00:00 2001 From: Michael Ferguson Date: Mon, 20 Jun 2022 22:08:19 -0400 Subject: [PATCH] fix regression from #1331 (#1384) The noted PR swapped boost::thread to std::thread - however std::thread will cause the program to crash with a note that TERMINATE CALLED WITHOUT ACTIVE EXCEPTION if the thread object goes out of scope while not joinable. Detaching the thread restores the original workflow prior to the PR and allows users to send more than one trajectory via the motion planning plugin in RVIZ (otherwise, it crashes on the first trajectory). --- .../planning_scene_rviz_plugin/src/planning_scene_display.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/moveit_ros/visualization/planning_scene_rviz_plugin/src/planning_scene_display.cpp b/moveit_ros/visualization/planning_scene_rviz_plugin/src/planning_scene_display.cpp index 96ab38edb63..a9d64197301 100644 --- a/moveit_ros/visualization/planning_scene_rviz_plugin/src/planning_scene_display.cpp +++ b/moveit_ros/visualization/planning_scene_rviz_plugin/src/planning_scene_display.cpp @@ -239,6 +239,7 @@ void PlanningSceneDisplay::addBackgroundJob(const std::function& job, co void PlanningSceneDisplay::spawnBackgroundJob(const std::function& job) { std::thread t(job); + t.detach(); } void PlanningSceneDisplay::addMainLoopJob(const std::function& job)