Skip to content

Commit

Permalink
Reset RMWCount when DEALLOC rmw storage of wait set (#209)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
jwang11 authored and dirk-thomas committed Jan 23, 2018
1 parent 4ed6c56 commit 1d35c60
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions rcl/src/rcl/wait.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ rcl_wait_set_get_allocator(const rcl_wait_set_t * wait_set, rcl_allocator_t * al
if (wait_set->impl->RMWStorage) { \
allocator.deallocate((void *)wait_set->impl->RMWStorage, allocator.state); \
wait_set->impl->RMWStorage = NULL; \
wait_set->impl->RMWCount = 0; \
}

#define SET_RESIZE_RMW_REALLOC(Type, RMWStorage, RMWCount) \
Expand Down

0 comments on commit 1d35c60

Please sign in to comment.