Skip to content

Commit

Permalink
Implement remove_node
Browse files Browse the repository at this point in the history
  • Loading branch information
esteve committed Jul 29, 2023
1 parent bde74f4 commit 5d1d03f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rclrs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ impl SingleThreadedExecutor {
}

fn remove_node(&self, node: Arc<Node>) -> Result<(), RclrsError> {
{ self.nodes_mtx.lock().unwrap() }
.retain(|n| !n.upgrade().map(|n| Arc::ptr_eq(&n, &node)).unwrap_or(false));
Ok(())
}

Expand Down

0 comments on commit 5d1d03f

Please sign in to comment.