File tree 1 file changed +5
-2
lines changed
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 {}
65
65
/// [3]: crate::NodeBuilder::new
66
66
/// [4]: crate::NodeBuilder::namespace
67
67
pub struct Node {
68
- pub ( crate ) rcl_node_mtx : Arc < Mutex < rcl_node_t > > ,
69
- pub ( crate ) rcl_context_mtx : Arc < Mutex < rcl_context_t > > ,
70
68
pub ( crate ) clients_mtx : Mutex < Vec < Weak < dyn ClientBase > > > ,
71
69
pub ( crate ) guard_conditions_mtx : Mutex < Vec < Weak < GuardCondition > > > ,
72
70
pub ( crate ) services_mtx : Mutex < Vec < Weak < dyn ServiceBase > > > ,
73
71
pub ( crate ) subscriptions_mtx : Mutex < Vec < Weak < dyn SubscriptionBase > > > ,
74
72
time_source : TimeSource ,
75
73
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 > > ,
76
79
}
77
80
78
81
impl Eq for Node { }
You can’t perform that action at this time.
0 commit comments