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

Disable RTPSParticipantImpl after removing it from RTPSDomain participants list [15313] #2892

Merged
merged 2 commits into from
Jul 28, 2022
Merged
Changes from all commits
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
2 changes: 1 addition & 1 deletion src/cpp/rtps/RTPSDomain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ bool RTPSDomain::removeRTPSParticipant(
if (p != nullptr)
{
assert((p->mp_impl != nullptr) && "This participant has been previously invalidated");
p->mp_impl->disable();

std::unique_lock<std::mutex> lock(m_mutex);
for (auto it = m_RTPSParticipants.begin(); it != m_RTPSParticipants.end(); ++it)
Expand All @@ -270,6 +269,7 @@ bool RTPSDomain::removeRTPSParticipant(
void RTPSDomain::removeRTPSParticipant_nts(
RTPSDomain::t_p_RTPSParticipant& participant)
{
participant.second->disable();
// The destructor of RTPSParticipantImpl already deletes the associated RTPSParticipant and sets
// its pointer to the RTPSParticipant to nullptr, so there is no need to do it here manually.
delete(participant.second);
Expand Down