Function rcutils_char_array_fini

Function Documentation

rcutils_ret_t rcutils_char_array_fini(rcutils_char_array_t *char_array)

Finalize a char array struct.

Cleans up and deallocates any resources owned by rcutils_char_array_t. The array passed to this function needs to have been initialized by rcutils_char_array_init(). If .owns_buffer is false, this function has no effect because that implies that the char_array does not own the internal buffer. Passing an uninitialized instance to this function leads to undefined behavior.

Parameters:

char_array[in] pointer to the rcutils_char_array_t to be cleaned up

Returns:

RCUTILS_RET_OK if successful, or

Returns:

RCUTILS_RET_INVALID_ARGUMENT if the char_array argument is invalid

Returns:

RCUTILS_RET_ERROR if an unexpected error occurs.