Function rmw_destroy_publisher

Function Documentation

rmw_ret_t rmw_destroy_publisher(rmw_node_t *node, rmw_publisher_t *publisher)

Finalize a given publisher handle, reclaim the resources, and deallocate the publisher handle.

This function will return early if a logical error, such as RMW_RET_INVALID_ARGUMENT or RMW_RET_INCORRECT_RMW_IMPLEMENTATION, ensues, leaving the given publisher handle unchanged. Otherwise, it will proceed despite errors, freeing as many resources as it can, including the publisher handle. Usage of a deallocated publisher handle is undefined behavior.

Attribute

Adherence

Allocates Memory

No

Thread-Safe

No

Uses Atomics

Maybe [1]

Lock-Free

Maybe [1]

[1] rmw implementation defined, check the implementation documentation

Pre:

Given node must be the one the publisher was registered with.

Parameters:
  • node[in] Handle to node with which the given publisher is registered

  • publisher[in] Handle to publisher to be finalized

Returns:

RMW_RET_OK if successful, or

Returns:

RMW_RET_INVALID_ARGUMENT if node or publisher is NULL, or

Returns:

RMW_RET_INCORRECT_RMW_IMPLEMENTATION if node or publisher implementation identifier does not match, or

Returns:

RMW_RET_ERROR if an unexpected error occurs.