### Method

# Gio Drive eject

deprecated: 2.22

#### Declaration

    void
    g_drive_eject (
      GDrive* drive,
      GMountUnmountFlags flags,
      GCancellable* cancellable,
      GAsyncReadyCallback callback,
      gpointer user_data
    )

#### Description

Asynchronously ejects a drive.

When the operation is finished, `callback` will be called. You can then call `g_drive_eject_finish()` to obtain the result of the operation.

Deprecated since: 2.22

Use `g_drive_eject_with_operation()` instead.

#### Parameters

`flags`

  Type: `GMountUnmountFlags`

  Flags affecting the unmount if required for eject.

`cancellable`

  Type: `GCancellable`

  Optional `GCancellable` object, `NULL` to ignore.

  The argument can be `NULL`.
  The data is owned by the caller of the method.

`callback`

  Type: `GAsyncReadyCallback`

  A `GAsyncReadyCallback`, or `NULL`.

  The argument can be `NULL`.

`user_data`

  Type: `gpointer`

  User data to pass to `callback`.

  The argument can be `NULL`.
  The data is owned by the caller of the method.