Skip to content

Commit

Permalink
shutdown services in destructor of ClearCostmapService (ros-navigat…
Browse files Browse the repository at this point in the history
…ion#4495)

Signed-off-by: GoesM_server <[email protected]>
Co-authored-by: GoesM_server <[email protected]>
  • Loading branch information
2 people authored and Marc-Morcos committed Jul 4, 2024
1 parent e693205 commit 026431e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ class ClearCostmapService
*/
ClearCostmapService() = delete;

/**
* @brief A destructor
*/
~ClearCostmapService();

/**
* @brief Clears the region outside of a user-specified area reverting to the static map
*/
Expand Down
8 changes: 8 additions & 0 deletions nav2_costmap_2d/src/clear_costmap_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ ClearCostmapService::ClearCostmapService(
std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
}

ClearCostmapService::~ClearCostmapService()
{
// make sure services shutdown.
clear_except_service_.reset();
clear_around_service_.reset();
clear_entire_service_.reset();
}

void ClearCostmapService::clearExceptRegionCallback(
const shared_ptr<rmw_request_id_t>/*request_header*/,
const shared_ptr<ClearExceptRegion::Request> request,
Expand Down

0 comments on commit 026431e

Please sign in to comment.