Skip to content
Merged
Changes from 1 commit
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
3 changes: 3 additions & 0 deletions rclcpp/src/rclcpp/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ Context::shutdown(const std::string & reason)
++it;
}
}
// clear sub contexts
std::lock_guard<std::recursive_mutex> lock(sub_contexts_mutex_);
sub_contexts_.clear();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is a safe solution to this issue because things may re-add the sub contexts after shutdown. See my comment:

#893 (comment)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wjwwood

Thanks for your comments.
Based on your comments #893 (comment), I will use weak pointer to fix this issue

return true;
}

Expand Down