From 357016c6011b22125f708052b8b572450e81cb20 Mon Sep 17 00:00:00 2001 From: Mauro Passerino Date: Fri, 18 Aug 2023 11:30:57 +0100 Subject: [PATCH] Unset gc's callback on ~EventsExecutorNotifyWaitable() --- .../rclcpp/executors/events_executor_notify_waitable.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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