Skip to content

Commit

Permalink
change pointer free order in amcl to avoid use-after-free bug mention…
Browse files Browse the repository at this point in the history
…ed in ros-navigation#4068 (ros-navigation#4070)

Signed-off-by: GoesM <[email protected]>
Co-authored-by: GoesM <[email protected]>
Signed-off-by: enricosutera <[email protected]>
  • Loading branch information
2 people authored and enricosutera committed May 19, 2024
1 parent c59d4ed commit b5905a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nav2_amcl/src/amcl_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ AmclNode::on_cleanup(const rclcpp_lifecycle::State & /*state*/)
nomotion_update_srv_.reset();
initial_pose_sub_.reset();
laser_scan_connection_.disconnect();
tf_listener_.reset(); // listener may access lase_scan_filter_, so it should be reset earlier
laser_scan_filter_.reset();
laser_scan_sub_.reset();

Expand All @@ -341,7 +342,6 @@ AmclNode::on_cleanup(const rclcpp_lifecycle::State & /*state*/)

// Transforms
tf_broadcaster_.reset();
tf_listener_.reset();
tf_buffer_.reset();

// PubSub
Expand Down

0 comments on commit b5905a2

Please sign in to comment.