From 22b400d66ff3585e97c140e86d14a8466b8388aa Mon Sep 17 00:00:00 2001 From: Mario Dominguez Date: Mon, 3 Jun 2024 17:32:06 +0200 Subject: [PATCH] Refs #20816: Fix Signed-off-by: Mario Dominguez --- .../fastdds/domain/DomainParticipantImpl.cpp | 11 ++--------- .../fastdds/domain/DomainParticipantImpl.hpp | 2 ++ 2 files changed, 4 insertions(+), 9 deletions(-) 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;