Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shutdown services in destructor of ClearCostmapService #4495

Merged
merged 1 commit into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading