Skip to content

Commit

Permalink
Fix DataReaderHistory regression (#5327)
Browse files Browse the repository at this point in the history
* Refs #21694. Turn assertion into condition.

Signed-off-by: Miguel Company <[email protected]>

* Refs #21694. Fix uncrustify.

Signed-off-by: Miguel Company <[email protected]>

---------

Signed-off-by: Miguel Company <[email protected]>
(cherry picked from commit 837c6c8)
  • Loading branch information
MiguelCompany authored and mergify[bot] committed Oct 16, 2024
1 parent a8396fa commit 084d969
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/cpp/fastdds/subscriber/history/DataReaderHistory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -867,10 +867,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);
Expand Down

0 comments on commit 084d969

Please sign in to comment.