ParticipantImpl::~ParticipantImpl()
{
    while (m_publishers.size() > 0)
    {
        this->removePublisher(m_publishers.begin()->first);
    }
    while (m_subscribers.size() > 0)
    {
        this->removeSubscriber(m_subscribers.begin()->first);
    }

    if (this->mp_rtpsParticipant != nullptr)
    {
        RTPSDomain::removeRTPSParticipant(this->mp_rtpsParticipant);
    }

    delete(mp_participant);
}
ParticipantImpl::~ParticipantImpl()
{
    while (m_publishers.size() > 0)
    {
        this->removePublisher(m_publishers.begin()->first);
    }
    while (m_subscribers.size() > 0)
    {
        this->removeSubscriber(m_subscribers.begin()->first);
    }

    if (this->mp_rtpsParticipant != nullptr)
    {
        RTPSDomain::removeRTPSParticipant(this->mp_rtpsParticipant);
    }

    delete(mp_participant);
}