Skip to content

Commit

Permalink
Tweaks to client.c and subscription.c for cleaner init/fini
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Brawner <brawner@gmail.com>
  • Loading branch information
brawner committed Jul 29, 2020
1 parent af438bc commit b98e638
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions rcl/src/rcl/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ rcl_client_fini(rcl_client_t * client, rcl_node_t * node)
result = RCL_RET_ERROR;
}
allocator.deallocate(client->impl, allocator.state);
client->impl = NULL;
}
RCUTILS_LOG_DEBUG_NAMED(ROS_PACKAGE_NAME, "Client finalized");
return result;
Expand Down
2 changes: 2 additions & 0 deletions rcl/src/rcl/subscription.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ rcl_subscription_init(
fail:
if (subscription->impl) {
allocator->deallocate(subscription->impl, allocator->state);
subscription->impl = NULL;
}
ret = fail_ret;
// Fall through to cleanup
Expand Down Expand Up @@ -229,6 +230,7 @@ rcl_subscription_fini(rcl_subscription_t * subscription, rcl_node_t * node)
result = RCL_RET_ERROR;
}
allocator.deallocate(subscription->impl, allocator.state);
subscription->impl = NULL;
}
RCUTILS_LOG_DEBUG_NAMED(ROS_PACKAGE_NAME, "Subscription finalized");
return result;
Expand Down

0 comments on commit b98e638

Please sign in to comment.