Skip to content

Commit 6498e2f

Browse files
committed
Clarify rmw_destroy_node() side effects.
Signed-off-by: Michel Hidalgo <[email protected]>
1 parent 2442051 commit 6498e2f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

rmw/include/rmw/rmw.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,11 @@ rmw_create_node(
173173

174174
/// Finalize a given node handle, reclaim the resources, and deallocate the node handle.
175175
/**
176+
* This function will return early if a logical error, such as `RMW_RET_INVALID_ARGUMENT`
177+
* or `RMW_RET_INCORRECT_RMW_IMPLEMENTATION`, ensues, leaving the given node handle unchanged.
178+
* Otherwise, it will proceed despite errors, freeing as much resources as it can, including
179+
* the node handle. Usage of a deallocated node handle is undefined behavior.
180+
*
176181
* \pre All publishers, subscribers, services, and clients created from this node must
177182
* have been destroyed prior to this call. Some rmw implementations may verify this,
178183
* returning `RMW_RET_ERROR` and setting a human readable error message if any entity

0 commit comments

Comments
 (0)