Skip to content

Commit

Permalink
shutdown services in destructor of ClearCostmapService
Browse files Browse the repository at this point in the history
Signed-off-by: GoesM_server <[email protected]>
  • Loading branch information
GoesM_server authored and GoesM_server committed Jun 26, 2024
1 parent 715df8f commit b06d09c
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 b06d09c

Please sign in to comment.