Fix SEGV caused by order of destruction of Node sub-interfaces (#1469) (#1736)

* added tear-down of node sub-interfaces in reverse order of their creation (#1469)

Signed-off-by: Colin MacKenzie <colin@flyingeinstein.com>

* added name of service to log message for leak detection. Previously it gave no indication of what node is causing the memory leak (#1469)

Signed-off-by: Colin MacKenzie <colin@flyingeinstein.com>
(cherry picked from commit b9ffd72f42ae44352256f2eab585299bf85c6346)

Co-authored-by: Colin MacKenzie <guru-florida@users.noreply.github.com>
This commit is contained in:
mergify[bot] 2021-08-03 17:03:02 -03:00 committed by GitHub
parent dc3832c4ec
commit 92fe787a74
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 6 deletions

View file

@ -126,7 +126,18 @@ LifecycleNode::LifecycleNode(
}
LifecycleNode::~LifecycleNode()
{}
{
// release sub-interfaces in an order that allows them to consult with node_base during tear-down
node_waitables_.reset();
node_time_source_.reset();
node_parameters_.reset();
node_clock_.reset();
node_services_.reset();
node_topics_.reset();
node_timers_.reset();
node_logging_.reset();
node_graph_.reset();
}
const char *
LifecycleNode::get_name() const