Skip to content

Commit

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

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

* Refs #21694. Fix uncrustify.

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>

---------

Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
(cherry picked from commit 837c6c8)

Co-authored-by: Miguel Company <miguelcompany@eprosima.com>
  • Loading branch information
mergify[bot] and MiguelCompany authored Oct 17, 2024
1 parent a8396fa commit bc0a2d2
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 bc0a2d2

Please sign in to comment.