Skip to content

Commit

Permalink
Refactor participants destructors to use delete_contained_entities()
Browse files Browse the repository at this point in the history
Signed-off-by: Irene Bandera <irenebandera@eprosima.com>
  • Loading branch information
irenebm committed Aug 20, 2024
1 parent f88e91b commit 4d5e24d
Showing 1 changed file with 2 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,7 @@ class TestPublisher
{
if (participant_ != nullptr)
{
if (publisher_ != nullptr)
{
if (writer_ != nullptr)
{
publisher_->delete_datawriter(writer_);
}
participant_->delete_publisher(publisher_);
}
if (topic_ != nullptr)
{
participant_->delete_topic(topic_);
}
participant_->delete_contained_entities();
eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->delete_participant(participant_);
}
}
Expand Down Expand Up @@ -281,18 +270,7 @@ class TestSubscriber
{
if (participant_ != nullptr)
{
if (topic_ != nullptr)
{
participant_->delete_topic(topic_);
}
if (subscriber_ != nullptr)
{
if (reader_ != nullptr)
{
subscriber_->delete_datareader(reader_);
}
participant_->delete_subscriber(subscriber_);
}
participant_->delete_contained_entities();
eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->delete_participant(participant_);
}
}
Expand Down

0 comments on commit 4d5e24d

Please sign in to comment.