Skip to content

Commit 874d4fb

Browse files
committed
node_handle must be destroyed after client_handle to prevent memory leak (ros2#1562)
Signed-off-by: Tomoya.Fujita <[email protected]>
1 parent 8f2809d commit 874d4fb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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)