diff --git a/include/fastdds/rtps/history/IPayloadPool.h b/include/fastdds/rtps/history/IPayloadPool.h index 9f37c54e61f..d08ea201e96 100644 --- a/include/fastdds/rtps/history/IPayloadPool.h +++ b/include/fastdds/rtps/history/IPayloadPool.h @@ -70,10 +70,9 @@ class IPayloadPool * * @returns whether the operation succeeded or not * - * @note @c data is received as reference to accommodate the case where several readers - * receive the same payload. If the payload has no owner, it means it is allocated on the stack of a + * @note If @c data has no owner, it means it is allocated on the stack of a * reception thread, and a copy should be performed. If the ownership of @c data needs to be changed, - * a consecutive call to this method needs to be called with the arguments swapped, leveraging the + * a consecutive call to this method needs to be performed with the arguments swapped, leveraging the * post-condition of this method which ensures that @c payload.payload_owner points to @c this. * * @post diff --git a/src/cpp/rtps/reader/StatefulReader.cpp b/src/cpp/rtps/reader/StatefulReader.cpp index c2ef5d477d4..2b047012ec7 100644 --- a/src/cpp/rtps/reader/StatefulReader.cpp +++ b/src/cpp/rtps/reader/StatefulReader.cpp @@ -645,8 +645,7 @@ bool StatefulReader::processDataMsg( { if (change->serializedPayload.payload_owner == nullptr) { - change_to_add->serializedPayload.payload_owner->get_payload(change_to_add->serializedPayload, - change->serializedPayload); + payload_pool_->get_payload(change_to_add->serializedPayload, change->serializedPayload); } } else diff --git a/src/cpp/rtps/reader/StatelessReader.cpp b/src/cpp/rtps/reader/StatelessReader.cpp index 9feb6b61887..ae8c6cdf270 100644 --- a/src/cpp/rtps/reader/StatelessReader.cpp +++ b/src/cpp/rtps/reader/StatelessReader.cpp @@ -639,8 +639,7 @@ bool StatelessReader::processDataMsg( { if (change->serializedPayload.payload_owner == nullptr) { - change_to_add->serializedPayload.payload_owner->get_payload(change_to_add->serializedPayload, - change->serializedPayload); + payload_pool_->get_payload(change_to_add->serializedPayload, change->serializedPayload); } } else