Skip to content

Commit d047214

Browse files
committed
Automatically clear dead nodes from the executor
Signed-off-by: Michael X. Grey <[email protected]>
1 parent b14e56e commit d047214

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

rclrs/src/executor.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ impl Executor {
7878
}
7979
}
8080

81+
// Clear out any nodes that have been dropped.
82+
self.nodes_mtx.lock().unwrap().retain(|weak_node| weak_node.strong_count() > 0);
83+
8184
Ok(())
8285
}
8386

0 commit comments

Comments
 (0)