From 837c6c8ea26637212724a55f1fb1489172dc6d93 Mon Sep 17 00:00:00 2001 From: Miguel Company Date: Wed, 16 Oct 2024 17:02:11 +0200 Subject: [PATCH] Fix DataReaderHistory regression (#5327) * Refs #21694. Turn assertion into condition. Signed-off-by: Miguel Company * Refs #21694. Fix uncrustify. Signed-off-by: Miguel Company --------- Signed-off-by: Miguel Company --- src/cpp/fastdds/subscriber/history/DataReaderHistory.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/cpp/fastdds/subscriber/history/DataReaderHistory.cpp b/src/cpp/fastdds/subscriber/history/DataReaderHistory.cpp index 1a209ad2300..2ce615f1933 100644 --- a/src/cpp/fastdds/subscriber/history/DataReaderHistory.cpp +++ b/src/cpp/fastdds/subscriber/history/DataReaderHistory.cpp @@ -862,10 +862,8 @@ bool DataReaderHistory::update_instance_nts( change->reader_info.no_writers_generation_count = vit->second->no_writers_generation_count; auto current_owner = vit->second->current_owner.first; - if (current_owner != previous_owner) + if ((current_owner != previous_owner) && (current_owner == change->writerGUID)) { - assert(current_owner == change->writerGUID); - // Remove all changes from different owners after the change. DataReaderInstance::ChangeCollection& changes = vit->second->cache_changes; auto it = std::lower_bound(changes.begin(), changes.end(), change, rtps::history_order_cmp);