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

Switch to one participant per context model #145

Merged
merged 9 commits into from
Apr 22, 2020
8 changes: 2 additions & 6 deletions rmw_cyclonedds_cpp/src/rmw_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,7 @@ struct CddsDomain
{}

~CddsDomain()
{
if (domain_handle > 0) {
static_cast<void>(dds_delete(domain_handle));
}
}
{}
};

struct rmw_context_impl_t
Expand Down Expand Up @@ -288,6 +284,7 @@ struct rmw_context_impl_t
CddsDomain & dom = gcdds.domains[domain_id];
assert(dom.refcount > 0);
if (--dom.refcount == 0) {
static_cast<void>(dds_delete(dom.domain_handle));
gcdds.domains.erase(domain_id);
}
}
Expand Down Expand Up @@ -738,7 +735,6 @@ static bool check_create_domain(dds_domainid_t did, rmw_localhost_only_t localho
RCUTILS_LOG_ERROR_NAMED(
"rmw_cyclonedds_cpp",
"rmw_create_node: failed to create domain, error %s", dds_strretcode(dom.domain_handle));
dds_delete(dom.domain_handle);
ivanpauno marked this conversation as resolved.
Show resolved Hide resolved
gcdds.domains.erase(did);
return false;
} else {
Expand Down