call to rmw_init, despite the lack of rmw_shutdown (#69)

See: https://github.com/ros2/rclcpp/pull/207/files#r73983227
This commit is contained in:
William Woodall 2016-08-26 18:08:58 -07:00 committed by GitHub
parent 0abda63db3
commit 03900d6af9

View file

@ -75,6 +75,13 @@ rcl_init(int argc, char ** argv, rcl_allocator_t allocator)
// A very unlikely race condition, but it is possile I think. // A very unlikely race condition, but it is possile I think.
// I've documented that rcl_init() and rcl_shutdown() are not thread-safe with each other. // I've documented that rcl_init() and rcl_shutdown() are not thread-safe with each other.
__rcl_allocator = allocator; // Set the new allocator. __rcl_allocator = allocator; // Set the new allocator.
// Initialize rmw_init.
rmw_ret_t rmw_ret = rmw_init();
if (rmw_ret != RMW_RET_OK) {
RCL_SET_ERROR_MSG(rmw_get_error_string_safe());
fail_ret = RCL_RET_ERROR;
goto fail;
}
// TODO(wjwwood): Remove rcl specific command line arguments. // TODO(wjwwood): Remove rcl specific command line arguments.
// For now just copy the argc and argv. // For now just copy the argc and argv.
__rcl_argc = argc; __rcl_argc = argc;