Skip to content

Commit 4476c92

Browse files
hidmicahcorde
authored andcommitted
Do not invalidate context before successful shutdown. (#761)
Signed-off-by: Michel Hidalgo <[email protected]>
1 parent 6d32b67 commit 4476c92

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

rcl/src/rcl/init.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,15 +244,15 @@ rcl_shutdown(rcl_context_t * context)
244244
return RCL_RET_ALREADY_SHUTDOWN;
245245
}
246246

247-
// reset the instance id to 0 to indicate "invalid"
248-
rcutils_atomic_store((atomic_uint_least64_t *)(&context->instance_id_storage), 0);
249-
250247
rmw_ret_t rmw_ret = rmw_shutdown(&(context->impl->rmw_context));
251248
if (RMW_RET_OK != rmw_ret) {
252249
RCL_SET_ERROR_MSG(rmw_get_error_string().str);
253250
return rcl_convert_rmw_ret_to_rcl_ret(rmw_ret);
254251
}
255252

253+
// reset the instance id to 0 to indicate "invalid"
254+
rcutils_atomic_store((atomic_uint_least64_t *)(&context->instance_id_storage), 0);
255+
256256
return RCL_RET_OK;
257257
}
258258

0 commit comments

Comments
 (0)