PtrArray.free

Frees the memory allocated for the glib.PtrArray If free_seg is TRUE it frees the memory block holding the elements as well. Pass FALSE if you want to free the glib.PtrArray wrapper but preserve the underlying array for use elsewhere. If the reference count of array is greater than one, the glib.PtrArray wrapper is preserved but the size of array will be set to zero.

If array contents point to dynamically-allocated memory, they should be freed separately if free_seg is TRUE and no GDestroyNotify function has been set for array.

This function is not thread-safe. If using a glib.PtrArray from multiple threads, use only the atomic PtrArray.ref and PtrArray.unref functions.

class PtrArray
void**
free
(
bool freeSeg
)

Parameters

freeSeg bool

if TRUE the actual pointer array is freed as well

Return Value

Type: void**

the pointer array if free_seg is FALSE, otherwise NULL. The pointer array should be freed using g_free().