### Method

# Ide Task set_return_on_cancel

#### Declaration

    void
    ide_task_set_return_on_cancel (
      IdeTask* self,
      gboolean return_on_cancel
    )

#### Description

Setting `return_on_cancel` to `TRUE` ensures that the task will cancel immediately when `GCancellable::cancelled` is emitted by the configured cancellable.

Setting this requires that the caller can ensure the configured `GMainContext` will outlive the threaded worker so that task state can be freed in a delayed fashion.

Available since: | 3.32

#### Parameters

`return_on_cancel` | `gboolean`
| If the task should return immediately when the `GCancellable` has been cancelled.