From 1d35c60c7b517ea70caa47af1b12d4b2e862d8ed Mon Sep 17 00:00:00 2001 From: jwang11 Date: Tue, 23 Jan 2018 13:57:09 +0800 Subject: [PATCH] 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 * setting RMWCount to 0 only when RMWStorage is set to NULL Signed-off-by: jwang --- rcl/src/rcl/wait.c | 1 + 1 file changed, 1 insertion(+) diff --git a/rcl/src/rcl/wait.c b/rcl/src/rcl/wait.c index 8ab0bbc..cd83146 100644 --- a/rcl/src/rcl/wait.c +++ b/rcl/src/rcl/wait.c @@ -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) \