diff --git a/rclcpp/include/rclcpp/executors/events_executor_notify_waitable.hpp b/rclcpp/include/rclcpp/executors/events_executor_notify_waitable.hpp index 21b89ae692..adea505fd4 100644 --- a/rclcpp/include/rclcpp/executors/events_executor_notify_waitable.hpp +++ b/rclcpp/include/rclcpp/executors/events_executor_notify_waitable.hpp @@ -41,7 +41,12 @@ class EventsExecutorNotifyWaitable final : public EventWaitable // Destructor RCLCPP_PUBLIC - virtual ~EventsExecutorNotifyWaitable() = default; + virtual ~EventsExecutorNotifyWaitable() + { + for (auto & gc : notify_guard_conditions_) { + gc->set_on_trigger_callback(nullptr); + } + } // The function is a no-op, since we only care of waking up the executor RCLCPP_PUBLIC