Skip to content

Commit

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

Please sign in to comment.