GLib.PtrArray.set_free_func
Description: Reference for GLib.PtrArray.set_free_func

### Function

# GLib PtrArrayset_free_func

since: 2.22

#### Declaration [src]

    void
    g_ptr_array_set_free_func (
      GPtrArray* array,
      GDestroyNotify element_free_func
    )

#### Description [src]

Sets a function for freeing each element when `array` is destroyed either via `g_ptr_array_unref()`, when `g_ptr_array_free()` is called with `free_segment` set to true or when removing elements.

Available since: 2.22

This function is not directly available to language bindings.

#### Parameters

`array`

  Type: An array of `gpointer`

  A pointer array.

  The data is owned by the caller of the function.

`element_free_func`

  Type: `GDestroyNotify`

  A function to free elements during destruction of `array`.