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

use shared_from_this to avoid crash on shutdown #179

Merged
merged 5 commits into from
Apr 7, 2020
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions mbf_costmap_nav/src/mbf_costmap_nav/costmap_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ CostmapWrapper::CostmapWrapper(const std::string &name, const TFPtr &tf_listener

CostmapWrapper::~CostmapWrapper()
{
shutdown_costmap_timer_.stop();
}


Expand Down
4 changes: 4 additions & 0 deletions mbf_costmap_nav/src/move_base_server_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,9 @@ int main(int argc, char **argv)
#endif
costmap_nav_srv_ptr = boost::make_shared<mbf_costmap_nav::CostmapNavigationServer>(tf_listener_ptr);
ros::spin();

// explicitly desctructor here, otherwise this class will be destructed
corot marked this conversation as resolved.
Show resolved Hide resolved
// after tearing down internally allocaled static variables
costmap_nav_srv_ptr.reset();
corot marked this conversation as resolved.
Show resolved Hide resolved
return EXIT_SUCCESS;
}