diff --git a/rclcpp_action/src/client.cpp b/rclcpp_action/src/client.cpp index 95ccb62..e0e47bc 100644 --- a/rclcpp_action/src/client.cpp +++ b/rclcpp_action/src/client.cpp @@ -100,8 +100,9 @@ public: rclcpp::Context::SharedPtr context_; rclcpp::node_interfaces::NodeGraphInterface::WeakPtr node_graph_; - std::shared_ptr client_handle{nullptr}; + // node_handle must be destroyed after client_handle to prevent memory leak std::shared_ptr node_handle{nullptr}; + std::shared_ptr client_handle{nullptr}; rclcpp::Logger logger; using ResponseCallback = std::function response)>;