reset wait_set type index in SET_RESIZE (#207)

It is dangerous to keep type index float when do SET_RESIZE. It is
possible that index greater than new size. Thus, set index to 0.

Signed-off-by: jwang <jing.j.wang@intel.com>
This commit is contained in:
jwang11 2018-01-19 10:49:46 +08:00 committed by William Woodall
parent c09f6428d5
commit 4ed6c56edd

View file

@ -296,6 +296,7 @@ rcl_wait_set_get_allocator(const rcl_wait_set_t * wait_set, rcl_allocator_t * al
} \
rcl_allocator_t allocator = wait_set->impl->allocator; \
wait_set->size_of_ ## Type ## s = 0; \
wait_set->impl->Type ## _index = 0; \
if (size == 0) { \
if (wait_set->Type ## s) { \
allocator.deallocate((void *)wait_set->Type ## s, allocator.state); \