From: Jérémie Galarneau Date: Mon, 18 Nov 2019 19:43:06 +0000 (-0500) Subject: Fix: invalid use of destructor in dynamic pointer array X-Git-Tag: v2.12.0-rc1~239 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=0186592a67a28417f1dabbb1790560d8cd1033d4;hp=0186592a67a28417f1dabbb1790560d8cd1033d4 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 ---