Skip to content

Commit 1d35c60

Browse files
jwang11dirk-thomas
authored andcommitted
Reset RMWCount when DEALLOC rmw storage of wait set (#209)
* Reset RMWCount when DEALLOC rmw storage of wait set It is safe to reset RMWCount when free rmw storage of wait set Signed-off-by: jwang <[email protected]> * setting RMWCount to 0 only when RMWStorage is set to NULL Signed-off-by: jwang <[email protected]>
1 parent 4ed6c56 commit 1d35c60

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

rcl/src/rcl/wait.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@ rcl_wait_set_get_allocator(const rcl_wait_set_t * wait_set, rcl_allocator_t * al
320320
if (wait_set->impl->RMWStorage) { \
321321
allocator.deallocate((void *)wait_set->impl->RMWStorage, allocator.state); \
322322
wait_set->impl->RMWStorage = NULL; \
323+
wait_set->impl->RMWCount = 0; \
323324
}
324325

325326
#define SET_RESIZE_RMW_REALLOC(Type, RMWStorage, RMWCount) \

0 commit comments

Comments
 (0)