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 389b341a195..1340de7fdcc 100644 --- a/src/cpp/rtps/reader/StatefulReader.cpp +++ b/src/cpp/rtps/reader/StatefulReader.cpp @@ -646,8 +646,7 @@ bool StatefulReader::process_data_msg( { 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 142e05c73e9..1878c3637f8 100644 --- a/src/cpp/rtps/reader/StatelessReader.cpp +++ b/src/cpp/rtps/reader/StatelessReader.cpp @@ -629,8 +629,7 @@ bool StatelessReader::process_data_msg( { 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