Skip to content

Commit

Permalink
Refs #21055. PDP::disable method automatically unmatches remote par…
Browse files Browse the repository at this point in the history
…ticipants.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
  • Loading branch information
MiguelCompany committed May 21, 2024
1 parent 3f8966e commit 4e89943
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/cpp/rtps/builtin/discovery/participant/PDP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,20 @@ bool PDP::enable()

void PDP::disable()
{
// Extract all the participant proxies excluding first one (ourselves)
std::vector<ParticipantProxyData*> participants;
{
std::lock_guard<std::recursive_mutex> guardPDP(*this->mp_mutex);
participants.insert(participants.end(), participant_proxies_.begin() + 1, participant_proxies_.end());
participant_proxies_.erase(participant_proxies_.begin() + 1, participant_proxies_.end());
}

// Unmatch all remote participants
for (ParticipantProxyData* pdata : participants)
{
remote_participant_removed(pdata, pdata->m_guid,
ParticipantDiscoveryInfo::DISCOVERY_STATUS::REMOVED_PARTICIPANT, nullptr);
}
}

void PDP::announceParticipantState(
Expand Down

0 comments on commit 4e89943

Please sign in to comment.