Function rmw_destroy_node
Defined in File rmw.h
Function Documentation
-
rmw_ret_t rmw_destroy_node(rmw_node_t *node)
Finalize a given node handle, reclaim the resources, and deallocate the node handle.
This function will return early if a logical error, such as
RMW_RET_INVALID_ARGUMENTorRMW_RET_INCORRECT_RMW_IMPLEMENTATION, ensues, leaving the given node handle unchanged. Otherwise, it will proceed despite errors, freeing as many resources as it can, including the node handle. Usage of a deallocated node handle is undefined behavior.- Parameters:
node – [in] the node handle to be destroyed
- Pre:
All publishers, subscribers, services, and clients created from this node must have been destroyed prior to this call. Some rmw implementations may verify this, returning
RMW_RET_ERRORand setting a human readable error message if any entity created from this node has not yet been destroyed. However, this is not guaranteed and so callers should ensure that this is the case before calling this function.- Returns:
RMW_RET_OKif successful, or- Returns:
RMW_RET_INVALID_ARGUMENTif node is invalid, or- Returns:
RMW_RET_INCORRECT_RMW_IMPLEMENTATIONif the implementation identifier does not match, or- Returns:
RMW_RET_ERRORif an unexpected error occurs.