### Function

# GimpUi widget_free_native_handle

#### Declaration [src]

    void
    gimp_widget_free_native_handle (
      GtkWidget* widget,
      GBytes** window_handle
    )

#### Description [src]

Disposes a widget’s native window handle created asynchronously after a previous call to gimp_widget_set_native_handle. This disposes what the pointer points to, a *GBytes, if any. Call this when the widget and the window handle it owns is being disposed.

This should be called at least once, paired with set_native_handle. This knows how to free `window_handle`, especially that on some platforms, an asynchronous callback must be canceled else it might call back with the pointer, after the widget and its private is freed.

This is safe to call when deferenced `window_handle` is NULL, when the window handle was never actually set, on Wayland where actual setting is asynchronous.

!!! The word “handle” has two meanings. A “window handle” is an ID of a window. A “handle” also commonly means a pointer to a pointer, in this case **GBytes. `window_handle` is both kinds of handle.

#### Parameters

`widget`

  Type: `GtkWidget`

  A `GtkWindow`.

  The data is owned by the caller of the function.

`window_handle`

  Type: `GBytes`

  Same pointer previously passed to set_native_handle.

  The argument will be set by the function.
  The caller of the function takes ownership of the returned data, and is responsible for freeing it.