Skip to content

Commit 40b6dce

Browse files
committed
Refs #21082. Fix release order in WriterHistory destructor.
Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
1 parent 275abe5 commit 40b6dce

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/cpp/rtps/history/WriterHistory.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,11 @@ WriterHistory::WriterHistory(
113113

114114
WriterHistory::~WriterHistory()
115115
{
116-
// TODO Auto-generated destructor stub
116+
// As releasing the change pool will delete the cache changes it owns,
117+
// the payload pool may be called to release their payloads, so we should
118+
// ensure that the payload pool is destroyed after the change pool.
119+
change_pool_.reset();
120+
payload_pool_.reset();
117121
}
118122

119123
const std::shared_ptr<IPayloadPool>& WriterHistory::get_payload_pool() const

0 commit comments

Comments
 (0)