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

Call Domain::removePublishe while failure occurs in create_publisher #434

Merged
merged 2 commits into from
Sep 18, 2020
Merged
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions rmw_fastrtps_cpp/src/publisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,13 @@ rmw_fastrtps_cpp::create_publisher(
}
auto cleanup_info = rcpputils::make_scope_exit(
[info, participant]() {
if (info->publisher_) {
if (!Domain::removePublisher(info->publisher_)) {
ivanpauno marked this conversation as resolved.
Show resolved Hide resolved
RMW_SAFE_FWRITE_TO_STDERR(
"Failed to remove publisher after '"
RCUTILS_STRINGIFY(__function__) "' failed.\n");
}
}
if (info->type_support_) {
_unregister_type(participant, info->type_support_);
}
Expand Down
7 changes: 7 additions & 0 deletions rmw_fastrtps_dynamic_cpp/src/publisher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,13 @@ rmw_fastrtps_dynamic_cpp::create_publisher(
}
auto cleanup_info = rcpputils::make_scope_exit(
[info, participant]() {
if (info->publisher_) {
if (!Domain::removePublisher(info->publisher_)) {
RMW_SAFE_FWRITE_TO_STDERR(
"Failed to remove publisher after '"
RCUTILS_STRINGIFY(__function__) "' failed.\n");
}
}
if (info->type_support_) {
_unregister_type(participant, info->type_support_);
}
Expand Down