diff --git a/rclrs/src/lib.rs b/rclrs/src/lib.rs index a259fc7c..0b032ac6 100644 --- a/rclrs/src/lib.rs +++ b/rclrs/src/lib.rs @@ -57,6 +57,8 @@ impl SingleThreadedExecutor { } fn remove_node(&self, node: Arc) -> Result<(), RclrsError> { + { self.nodes_mtx.lock().unwrap() } + .retain(|n| !n.upgrade().map(|n| Arc::ptr_eq(&n, &node)).unwrap_or(false)); Ok(()) }