Skip to content

Commit 47f21da

Browse files
authored
node_handle must be destroyed after client_handle to prevent memory leak (#1562) (#1565)
Signed-off-by: Tomoya Fujita <[email protected]>
1 parent 8f2809d commit 47f21da

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

rclcpp_action/src/client.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,9 @@ class ClientBaseImpl
100100

101101
rclcpp::Context::SharedPtr context_;
102102
rclcpp::node_interfaces::NodeGraphInterface::WeakPtr node_graph_;
103-
std::shared_ptr<rcl_action_client_t> client_handle{nullptr};
103+
// node_handle must be destroyed after client_handle to prevent memory leak
104104
std::shared_ptr<rcl_node_t> node_handle{nullptr};
105+
std::shared_ptr<rcl_action_client_t> client_handle{nullptr};
105106
rclcpp::Logger logger;
106107

107108
using ResponseCallback = std::function<void (std::shared_ptr<void> response)>;

0 commit comments

Comments
 (0)