Skip to content

Commit f116316

Browse files
doisygSteveMacenski
authored andcommitted
Fix Smac cleanup (#2477)
* fix smac2d cleanup * same for hybrid
1 parent 65f8d74 commit f116316

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

nav2_smac_planner/src/smac_planner_2d.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,10 @@ void SmacPlanner2D::cleanup()
184184
_name.c_str());
185185
_a_star.reset();
186186
_smoother.reset();
187-
_costmap_downsampler->on_cleanup();
188-
_costmap_downsampler.reset();
187+
if (_costmap_downsampler) {
188+
_costmap_downsampler->on_cleanup();
189+
_costmap_downsampler.reset();
190+
}
189191
_raw_plan_publisher.reset();
190192
}
191193

nav2_smac_planner/src/smac_planner_hybrid.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,10 @@ void SmacPlannerHybrid::cleanup()
221221
_name.c_str());
222222
_a_star.reset();
223223
_smoother.reset();
224-
_costmap_downsampler->on_cleanup();
225-
_costmap_downsampler.reset();
224+
if (_costmap_downsampler) {
225+
_costmap_downsampler->on_cleanup();
226+
_costmap_downsampler.reset();
227+
}
226228
_raw_plan_publisher.reset();
227229
}
228230

0 commit comments

Comments
 (0)