Skip to content

Commit

Permalink
Delete history_record when endpoint is unmatched (#1006)
Browse files Browse the repository at this point in the history
  • Loading branch information
IkerLuengo authored Feb 13, 2020
1 parent b257a33 commit a2c564a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/cpp/rtps/reader/RTPSReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,15 @@ void RTPSReader::add_persistence_guid(const RemoteWriterAttributes& wdata)
void RTPSReader::remove_persistence_guid(const RemoteWriterAttributes& wdata)
{
std::lock_guard<std::recursive_timed_mutex> guard(mp_mutex);
GUID_t persistence_guid = persistence_guid_map_[wdata.guid];
persistence_guid_map_.erase(wdata.guid);
auto count = --persistence_guid_count_[wdata.endpoint.persistence_guid];
if (count == 0)
auto count = --persistence_guid_count_[persistence_guid];
if (count <= 0)
{
if (m_att.durabilityKind < TRANSIENT)
{
history_record_.erase(wdata.endpoint.persistence_guid);
history_record_.erase(persistence_guid);
persistence_guid_count_.erase(persistence_guid);
}
}
}
Expand Down

0 comments on commit a2c564a

Please sign in to comment.