diff --git a/rclcpp/include/rclcpp/strategies/allocator_memory_strategy.hpp b/rclcpp/include/rclcpp/strategies/allocator_memory_strategy.hpp index 4b8e0334f8..e0af7f8d7d 100644 --- a/rclcpp/include/rclcpp/strategies/allocator_memory_strategy.hpp +++ b/rclcpp/include/rclcpp/strategies/allocator_memory_strategy.hpp @@ -391,9 +391,9 @@ class AllocatorMemoryStrategy : public memory_strategy::MemoryStrategy { auto & waitable_handles = waitable_triggered_handles_.empty() ? waitable_handles_ : waitable_triggered_handles_; - auto it = waitable_handles.begin(); - while (it != waitable_handles.end()) { - std::shared_ptr waitable = *it; + auto it = waitable_handles_.begin(); + while (it != waitable_handles_.end()) { + std::shared_ptr & waitable = *it; if (waitable) { // Find the group for this handle and see if it can be serviced auto group = get_group_by_waitable(waitable, weak_groups_to_nodes);