From 88aa8f848252c27af4a3a892b580588b6c049db9 Mon Sep 17 00:00:00 2001 From: Jacob Perron Date: Mon, 14 Jan 2019 16:49:19 -0800 Subject: [PATCH] Add missing logic to dynamic RMW client implementation (#254) Follow up from #238. --- rmw_fastrtps_dynamic_cpp/src/rmw_client.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/rmw_fastrtps_dynamic_cpp/src/rmw_client.cpp b/rmw_fastrtps_dynamic_cpp/src/rmw_client.cpp index 26619b2fe..0cbf937b2 100644 --- a/rmw_fastrtps_dynamic_cpp/src/rmw_client.cpp +++ b/rmw_fastrtps_dynamic_cpp/src/rmw_client.cpp @@ -95,6 +95,8 @@ rmw_create_client( info = new CustomClientInfo(); info->participant_ = participant; info->typesupport_identifier_ = type_support->typesupport_identifier; + info->request_publisher_matched_count_ = 0; + info->response_subscriber_matched_count_ = 0; const void * untyped_request_members; const void * untyped_response_members; @@ -183,8 +185,9 @@ rmw_create_client( RMW_SET_ERROR_MSG("failed to get datawriter qos"); goto fail; } + info->pub_listener_ = new ClientPubListener(info); info->request_publisher_ = - Domain::createPublisher(participant, publisherParam, nullptr); + Domain::createPublisher(participant, publisherParam, info->pub_listener_); if (!info->request_publisher_) { RMW_SET_ERROR_MSG("create_publisher() could not create publisher"); goto fail; @@ -220,6 +223,10 @@ rmw_create_client( Domain::removeSubscriber(info->response_subscriber_); } + if (info->pub_listener_ != nullptr) { + delete info->pub_listener_; + } + if (info->listener_ != nullptr) { delete info->listener_; }