Skip to content

Commit 9a59af2

Browse files
committed
Added reference to bug number.
Signed-off-by: Steve Wolter <[email protected]>
1 parent 71f3060 commit 9a59af2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

rclcpp/include/rclcpp/publisher_options.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ struct PublisherOptionsWithAllocator : public PublisherOptionsBase
7676
using MessageAllocatorT = typename AllocatorTraits::template rebind_alloc<MessageT>;
7777
auto message_alloc = std::make_shared<MessageAllocatorT>(*this->get_allocator().get());
7878
// TODO(stevewolter): This is likely to invoke undefined behavior - message_alloc goes
79-
// out of scope at the end of this function, but the allocator doesn't.
79+
// out of scope at the end of this function, but the allocator doesn't. See #1339.
8080
result.allocator = get_rcl_allocator(*message_alloc);
8181
result.qos = qos.get_rmw_qos_profile();
8282

rclcpp/include/rclcpp/subscription_options.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ struct SubscriptionOptionsWithAllocator : public SubscriptionOptionsBase
103103
using MessageAllocatorT = typename AllocatorTraits::template rebind_alloc<MessageT>;
104104
auto message_alloc = std::make_shared<MessageAllocatorT>(*allocator.get());
105105
// TODO(stevewolter): This is likely to invoke undefined behavior - message_alloc
106-
// goes out of scope at the end of this function, but the allocator doesn't.
106+
// goes out of scope at the end of this function, but the allocator doesn't. See #1339.
107107
result.allocator = get_rcl_allocator(*message_alloc);
108108
result.qos = qos.get_rmw_qos_profile();
109109
result.rmw_subscription_options.ignore_local_publications = this->ignore_local_publications;

0 commit comments

Comments
 (0)