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

[21055] Automatically unmatch remote participants on participant deletion #4817

Merged
merged 9 commits into from
May 27, 2024
34 changes: 17 additions & 17 deletions src/cpp/rtps/builtin/BuiltinProtocols.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,19 @@ BuiltinProtocols::BuiltinProtocols()

BuiltinProtocols::~BuiltinProtocols()
{
// This needs to be done first because of the WriterProxydata and ReaderProxyData smart_ptr
delete typelookup_manager_;

// Send participant is disposed
if (mp_PDP != nullptr)
if (nullptr != mp_PDP)
{
// Send participant is disposed
mp_PDP->announceParticipantState(true, true);
// Consider all discovered participants as disposed
mp_PDP->disable();
}

// TODO Auto-generated destructor stub
// The type lookup manager should be deleted first, since it will access the PDP database
delete typelookup_manager_;

delete mp_WLP;
delete mp_PDP;

}

bool BuiltinProtocols::initBuiltinProtocols(
Expand Down Expand Up @@ -193,7 +193,7 @@ bool BuiltinProtocols::addLocalWriter(
{
bool ok = true;

if (mp_PDP != nullptr)
if (nullptr != mp_PDP)
{
ok = mp_PDP->getEDP()->newLocalWriterProxyData(w, topicAtt, wqos);

Expand All @@ -208,7 +208,7 @@ bool BuiltinProtocols::addLocalWriter(
EPROSIMA_LOG_WARNING(RTPS_EDP, "EDP is not used in this Participant, register a Writer is impossible");
}

if (mp_WLP != nullptr)
if (nullptr != mp_WLP)
{
ok &= mp_WLP->add_local_writer(w, wqos);
}
Expand All @@ -228,7 +228,7 @@ bool BuiltinProtocols::addLocalReader(
{
bool ok = true;

if (mp_PDP != nullptr)
if (nullptr != mp_PDP)
{
ok = mp_PDP->getEDP()->newLocalReaderProxyData(R, topicAtt, rqos, content_filter);

Expand All @@ -243,7 +243,7 @@ bool BuiltinProtocols::addLocalReader(
EPROSIMA_LOG_WARNING(RTPS_EDP, "EDP is not used in this Participant, register a Reader is impossible");
}

if (mp_WLP != nullptr)
if (nullptr != mp_WLP)
{
ok &= mp_WLP->add_local_reader(R, rqos);
}
Expand All @@ -257,7 +257,7 @@ bool BuiltinProtocols::updateLocalWriter(
const fastdds::dds::WriterQos& wqos)
{
bool ok = false;
if (mp_PDP != nullptr && mp_PDP->getEDP() != nullptr)
if ((nullptr != mp_PDP) && (nullptr != mp_PDP->getEDP()))
{
ok = mp_PDP->getEDP()->updatedLocalWriter(W, topicAtt, wqos);
}
Expand All @@ -271,7 +271,7 @@ bool BuiltinProtocols::updateLocalReader(
const fastdds::rtps::ContentFilterProperty* content_filter)
{
bool ok = false;
if (mp_PDP != nullptr && mp_PDP->getEDP() != nullptr)
if ((nullptr != mp_PDP) && (nullptr != mp_PDP->getEDP()))
{
ok = mp_PDP->getEDP()->updatedLocalReader(R, topicAtt, rqos, content_filter);
}
Expand All @@ -282,11 +282,11 @@ bool BuiltinProtocols::removeLocalWriter(
RTPSWriter* W)
{
bool ok = false;
if (mp_WLP != nullptr)
if (nullptr != mp_WLP)
{
ok |= mp_WLP->remove_local_writer(W);
}
if (mp_PDP != nullptr && mp_PDP->getEDP() != nullptr)
if ((nullptr != mp_PDP) && (nullptr != mp_PDP->getEDP()))
{
ok |= mp_PDP->getEDP()->removeLocalWriter(W);
}
Expand All @@ -297,11 +297,11 @@ bool BuiltinProtocols::removeLocalReader(
RTPSReader* R)
{
bool ok = false;
if (mp_WLP != nullptr)
if (nullptr != mp_WLP)
{
ok |= mp_WLP->remove_local_reader(R);
}
if (mp_PDP != nullptr && mp_PDP->getEDP() != nullptr)
if ((nullptr != mp_PDP) && (nullptr != mp_PDP->getEDP()))
{
ok |= mp_PDP->getEDP()->removeLocalReader(R);
}
Expand Down
Loading
Loading