### Function

# GLib clear_list

since: 2.64

#### Declaration [src]

    void
    g_clear_list (
      GList** list_ptr,
      GDestroyNotify destroy
    )

#### Description [src]

Clears a pointer to a `GList`, freeing it and, optionally, freeing its elements using `destroy`.

`list_ptr` must be a valid pointer. If `list_ptr` points to a null `GList`, this does nothing.

Available since: 2.64

This function is not directly available to language bindings.

#### Parameters

`list_ptr`

  Type: A list of `gpointer`

  A `GList` return location.

  The data is owned by the caller of the function.

`destroy`

  Type: `GDestroyNotify`

  The function to pass to `g_list_free_full()` or `NULL` to not free elements.

  The argument can be `NULL`.