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:
parent
c09f6428d5
commit
4ed6c56edd
1 changed files with 1 additions and 0 deletions
|
@ -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; \
|
rcl_allocator_t allocator = wait_set->impl->allocator; \
|
||||||
wait_set->size_of_ ## Type ## s = 0; \
|
wait_set->size_of_ ## Type ## s = 0; \
|
||||||
|
wait_set->impl->Type ## _index = 0; \
|
||||||
if (size == 0) { \
|
if (size == 0) { \
|
||||||
if (wait_set->Type ## s) { \
|
if (wait_set->Type ## s) { \
|
||||||
allocator.deallocate((void *)wait_set->Type ## s, allocator.state); \
|
allocator.deallocate((void *)wait_set->Type ## s, allocator.state); \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue