Skip to content

Commit

Permalink
Add missing logic to dynamic RMW client implementation (#254)
Browse files Browse the repository at this point in the history
Follow up from #238.
  • Loading branch information
jacobperron authored Jan 15, 2019
1 parent d8f1959 commit 88aa8f8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion rmw_fastrtps_dynamic_cpp/src/rmw_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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_;
}
Expand Down

0 comments on commit 88aa8f8

Please sign in to comment.