rclcpp icon indicating copy to clipboard operation
rclcpp copied to clipboard

Add weak_ptr<void> callback_lifetime to SubscriptionOptions

Open ewak opened this issue 1 year ago • 0 comments

Avoid potential use after free usage of a registered subscription callback function by allowing user to specify a weak_ptr to be checked for expiry before the associated subscription callback is called.

If user does not specify callback_lifetime, the mechanism falls back to a tracking the lifetime of a user specified callback_group, failing that it tracks the lifetime of the nodes default_callback_group.

ewak avatar Jan 12 '25 12:01 ewak