### Function

# GimpUi widget_free_native_handle

since: 3.0

#### Declaration [src]

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

#### Description [src]

Disposes a widget’s native window handle created, possibly asynchronously, by a previous call to `gimp_widget_set_native_handle()`.

Depending on the platform, this function may also execute other necessary clean up so you should call it and not simply free the `GBytes` yourself.

You should call this function in the `dispose()` implementation of your custom widget before chaining up with the parent class’ `dispose()` call. The first call to the parent’s `dispose()` will destroy the `GdkWindow` which will prevent this function to do part of its cleanup when run after. This may result in crashes on some platforms.

This is safe to call even if deferenced `window_handle` is `NULL`, i.e. that you don’t have to check if the window handle was actually set.

Available since: 3.0

#### Parameters

`widget`

  Type: `GtkWidget`

  A widget we got a handle for.

  The data is owned by the caller of the function.

`window_handle`

  Type: `GBytes`

  Same pointer previously passed to `gimp_widget_set_native_handle()`.

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