File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -65,14 +65,17 @@ unsafe impl Send for rcl_node_t {}
6565/// [3]: crate::NodeBuilder::new
6666/// [4]: crate::NodeBuilder::namespace
6767pub struct Node {
68- pub ( crate ) rcl_node_mtx : Arc < Mutex < rcl_node_t > > ,
69- pub ( crate ) rcl_context_mtx : Arc < Mutex < rcl_context_t > > ,
7068 pub ( crate ) clients_mtx : Mutex < Vec < Weak < dyn ClientBase > > > ,
7169 pub ( crate ) guard_conditions_mtx : Mutex < Vec < Weak < GuardCondition > > > ,
7270 pub ( crate ) services_mtx : Mutex < Vec < Weak < dyn ServiceBase > > > ,
7371 pub ( crate ) subscriptions_mtx : Mutex < Vec < Weak < dyn SubscriptionBase > > > ,
7472 time_source : TimeSource ,
7573 parameter : ParameterInterface ,
74+ // Note: it's important to have those last since `drop` will be called in order of declaration
75+ // in the struct and both `TimeSource` and `ParameterInterface` contain subscriptions /
76+ // services that will fail to be dropped if the context or node is destroyed first.
77+ pub ( crate ) rcl_node_mtx : Arc < Mutex < rcl_node_t > > ,
78+ pub ( crate ) rcl_context_mtx : Arc < Mutex < rcl_context_t > > ,
7679}
7780
7881impl Eq for Node { }
You can’t perform that action at this time.
0 commit comments