diff --git a/src/cpp/rtps/builtin/discovery/participant/PDP.cpp b/src/cpp/rtps/builtin/discovery/participant/PDP.cpp index 33a72690e8e..58e92281149 100644 --- a/src/cpp/rtps/builtin/discovery/participant/PDP.cpp +++ b/src/cpp/rtps/builtin/discovery/participant/PDP.cpp @@ -339,7 +339,11 @@ bool PDP::initPDP( } //UPDATE METATRAFFIC. mp_builtin->updateMetatrafficLocators(this->mp_PDPReader->getAttributes().unicastLocatorList); + + mp_mutex->lock(); ParticipantProxyData* pdata = add_participant_proxy_data(part->getGuid(), true); + mp_mutex->unlock(); + if (pdata == nullptr) { return false;