From 5d1d03f588dc7c2c9af35ad1ede1763e3496d747 Mon Sep 17 00:00:00 2001 From: Esteve Fernandez Date: Sat, 29 Jul 2023 13:54:59 +0200 Subject: [PATCH] Implement remove_node --- rclrs/src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) 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(()) }