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

Do not invalidate context before successful shutdown. #761

Merged
merged 1 commit into from
Aug 25, 2020
Merged
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
6 changes: 3 additions & 3 deletions rcl/src/rcl/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,15 +241,15 @@ rcl_shutdown(rcl_context_t * context)
return RCL_RET_ALREADY_SHUTDOWN;
}

// reset the instance id to 0 to indicate "invalid"
rcutils_atomic_store((atomic_uint_least64_t *)(&context->instance_id_storage), 0);

rmw_ret_t rmw_ret = rmw_shutdown(&(context->impl->rmw_context));
if (RMW_RET_OK != rmw_ret) {
RCL_SET_ERROR_MSG(rmw_get_error_string().str);
return rcl_convert_rmw_ret_to_rcl_ret(rmw_ret);
}

// reset the instance id to 0 to indicate "invalid"
rcutils_atomic_store((atomic_uint_least64_t *)(&context->instance_id_storage), 0);

return RCL_RET_OK;
}

Expand Down