diff --git a/rmw_zenoh_cpp/src/detail/rmw_subscription_data.cpp b/rmw_zenoh_cpp/src/detail/rmw_subscription_data.cpp index 988c9ffc..1f0239c6 100644 --- a/rmw_zenoh_cpp/src/detail/rmw_subscription_data.cpp +++ b/rmw_zenoh_cpp/src/detail/rmw_subscription_data.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include "attachment_helpers.hpp" #include "cdr.hpp" @@ -43,7 +44,7 @@ namespace rmw_zenoh_cpp { ///============================================================================= SubscriptionData::Message::Message( - std::vector&& p, + std::vector && p, uint64_t recv_ts, AttachmentData && attachment_) : payload(std::move(p)), recv_timestamp(recv_ts), attachment(std::move(attachment_)) @@ -287,7 +288,6 @@ bool SubscriptionData::init() zenoh::Subscriber sub = context_impl->session()->declare_subscriber( sub_ke, [data_wp](const zenoh::Sample & sample) { - auto sub_data = data_wp.lock(); if (sub_data == nullptr) { RMW_ZENOH_LOG_ERROR_NAMED( diff --git a/rmw_zenoh_cpp/src/detail/rmw_subscription_data.hpp b/rmw_zenoh_cpp/src/detail/rmw_subscription_data.hpp index e6b2afad..a3fab3f9 100644 --- a/rmw_zenoh_cpp/src/detail/rmw_subscription_data.hpp +++ b/rmw_zenoh_cpp/src/detail/rmw_subscription_data.hpp @@ -25,6 +25,7 @@ #include #include #include +#include #include @@ -50,7 +51,7 @@ class SubscriptionData final : public std::enable_shared_from_this&& p, + std::vector && p, uint64_t recv_ts, AttachmentData && attachment);