Skip to content

Commit 60154a1

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

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
@@ -114,7 +114,11 @@ WriterHistory::WriterHistory(
114114

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

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

0 commit comments

Comments
 (0)