Skip to content

Commit

Permalink
Refs #20866. Fix issue.
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
  • Loading branch information
MiguelCompany committed Aug 30, 2024
1 parent f701b39 commit eafd07d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/cpp/fastdds/subscriber/DataReaderImpl/ReadTakeCommand.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,18 @@ struct ReadTakeCommand
while (!finished_ && it != instance_->second->cache_changes.end())
{
CacheChange_t* change = *it;

// Check if we need to remove the change due to ownership
if ( (instance_->second->current_owner.second < std::numeric_limits<uint32_t>::max()) &&
(instance_->second->current_owner.first != change->writerGUID))
{
// Remove from history
history_.remove_change_sub(change, it);

// Current iterator will point to change next to the one removed. Avoid incrementing.
continue;
}

SampleStateKind check;
check = change->isRead ? SampleStateKind::READ_SAMPLE_STATE : SampleStateKind::NOT_READ_SAMPLE_STATE;
if ((check & states_.sample_states) != 0)
Expand Down

0 comments on commit eafd07d

Please sign in to comment.