Fix: invalid use of destructor in dynamic pointer array
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 18 Nov 2019 19:43:06 +0000 (14:43 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 22 Nov 2019 21:22:14 +0000 (16:22 -0500)
commitb7912f944d7f9548ea811fd81c7df321b829efd5
tree657371314077a8e0ba4ddb0e796d3a8a0a535d4f
parentde011059af0823b128dd8dbd39e1a96f68147157
Fix: invalid use of destructor in dynamic pointer array

A dynamic pointer array is built on top of a dynamic array and uses
the dynamic array's internal "destructor" field to store the
user-specified destructor.

lttng_dynamic_pointer_array_remove_pointer currently uses
the dynamic array's remove_element directly which causes the
user destructor to be called with the underlying storage of the
pointer rather than with the pointer itself.

This change re-uses the same pattern as
lttng_dynamic_pointer_array_reset(), namely using the destructor
explicitly and setting it to NULL for the duration of the call to
the dynamic array API.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/dynamic-array.c
src/common/dynamic-array.h
This page took 0.02618 seconds and 4 git commands to generate.