diff --git a/src/cpp/statistics/fastdds/domain/DomainParticipantImpl.cpp b/src/cpp/statistics/fastdds/domain/DomainParticipantImpl.cpp index 9eb6c315f6e..6cb91c8ba9a 100644 --- a/src/cpp/statistics/fastdds/domain/DomainParticipantImpl.cpp +++ b/src/cpp/statistics/fastdds/domain/DomainParticipantImpl.cpp @@ -287,15 +287,8 @@ void DomainParticipantImpl::disable() ReturnCode_t DomainParticipantImpl::delete_contained_entities() { - ReturnCode_t ret = efd::DomainParticipantImpl::delete_contained_entities(); - - if (ret == efd::RETCODE_OK) - { - builtin_publisher_impl_ = nullptr; - builtin_publisher_ = nullptr; - } - - return ret; + delete_statistics_builtin_entities(); + return efd::DomainParticipantImpl::delete_contained_entities(); } ReturnCode_t DomainParticipantImpl::enable_monitor_service() diff --git a/src/cpp/statistics/fastdds/domain/DomainParticipantImpl.hpp b/src/cpp/statistics/fastdds/domain/DomainParticipantImpl.hpp index 08b64d57d6b..0c977d6b7fa 100644 --- a/src/cpp/statistics/fastdds/domain/DomainParticipantImpl.hpp +++ b/src/cpp/statistics/fastdds/domain/DomainParticipantImpl.hpp @@ -119,6 +119,8 @@ class DomainParticipantImpl : public efd::DomainParticipantImpl, * @brief This override calls the parent method and returns builtin publishers to nullptr * * @return RETCODE_OK if successful + * @note This method is meant to be used followed by a deletion of the participant as it implies + * the deletion of the builtin statistics publishers. */ efd::ReturnCode_t delete_contained_entities() override;