You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Stop storing the context in the guard condition. (#2400)
* Stop storing the context in the guard condition.
This was creating a circular reference between GuardCondition
and Context, so that Context would never be cleaned up.
Since we never really need the GuardCondition to know
about its own Context, remove that part of the circular
reference.
While we are in here, we also change the get_context()
lambda to a straight weak_ptr; there is no reason for the
indirection since the context for the guard condition
cannot change at runtime.
We also remove the deprecated version of the
get_notify_guard_condition(). That's because there is
no way to properly implement it in the new scheme, and
it seems to be unused outside of rclcpp.
Finally, we add in a test that guarantees the use_count
is what we expect when inside and leaving a scope, ensuring
that contexts will properly be destroyed.
Signed-off-by: Chris Lalancette <[email protected]>
0 commit comments