Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tweaks to client.c and subscription.c for cleaner init/fini #728

Merged
merged 1 commit into from
Aug 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions rcl/src/rcl/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ rcl_client_init(
fail:
if (client->impl) {
allocator->deallocate(client->impl, allocator->state);
client->impl = NULL;
}
ret = fail_ret;
// Fall through to cleanup
Expand Down Expand Up @@ -223,6 +224,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
1 change: 1 addition & 0 deletions rcl/src/rcl/publisher.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ rcl_publisher_fini(rcl_publisher_t * publisher, rcl_node_t * node)
result = RCL_RET_ERROR;
}
allocator.deallocate(publisher->impl, allocator.state);
publisher->impl = NULL;
}
RCUTILS_LOG_DEBUG_NAMED(ROS_PACKAGE_NAME, "Publisher finalized");
return result;
Expand Down
2 changes: 2 additions & 0 deletions rcl/src/rcl/service.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ rcl_service_init(
fail:
if (service->impl) {
allocator->deallocate(service->impl, allocator->state);
service->impl = NULL;
}
ret = fail_ret;
// Fall through to clean up
Expand Down Expand Up @@ -228,6 +229,7 @@ rcl_service_fini(rcl_service_t * service, rcl_node_t * node)
result = RCL_RET_ERROR;
}
allocator.deallocate(service->impl, allocator.state);
service->impl = NULL;
}
RCUTILS_LOG_DEBUG_NAMED(ROS_PACKAGE_NAME, "Service finalized");
return result;
Expand Down