Skip to content

Commit a759808

Browse files
fujitatomoyaKarsten1987
authored andcommitted
node_handle must be destroyed after client_handle to prevent memory leak (#1562)
Signed-off-by: Tomoya.Fujita <[email protected]>
1 parent bb0dc35 commit a759808

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
@@ -102,8 +102,9 @@ class ClientBaseImpl
102102

103103
rclcpp::Context::SharedPtr context_;
104104
rclcpp::node_interfaces::NodeGraphInterface::WeakPtr node_graph_;
105-
std::shared_ptr<rcl_action_client_t> client_handle{nullptr};
105+
// node_handle must be destroyed after client_handle to prevent memory leak
106106
std::shared_ptr<rcl_node_t> node_handle{nullptr};
107+
std::shared_ptr<rcl_action_client_t> client_handle{nullptr};
107108
rclcpp::Logger logger;
108109

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

0 commit comments

Comments
 (0)