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 <jing.j.wang@intel.com>

* setting RMWCount to 0 only when RMWStorage is set to NULL

Signed-off-by: jwang <jing.j.wang@intel.com>
This commit is contained in:
jwang11 2018-01-23 13:57:09 +08:00 committed by Dirk Thomas
parent 4ed6c56edd
commit 1d35c60c7b

View file

@ -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) \