Skip to content

Commit

Permalink
Do not invalidate context before successful shutdown. (#761)
Browse files Browse the repository at this point in the history
Signed-off-by: Michel Hidalgo <michel@ekumenlabs.com>
  • Loading branch information
hidmic authored and ahcorde committed Nov 2, 2020
1 parent 6d32b67 commit 4476c92
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rcl/src/rcl/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,15 +244,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

0 comments on commit 4476c92

Please sign in to comment.