Task.returnPointer
void returnPointer(void * result = null, glib.types.DestroyNotify resultDestroy = null)Sets task's result to result and completes the task. If result is not null, then result_destroy will be used to free result if the caller does not take ownership of it with [gio.task.Task.propagatePointer].
"Completes the task" means that for an ordinary asynchronous task it will either invoke the task's callback, or else queue that callback to be invoked in the proper #GMainContext, or in the next iteration of the current #GMainContext. For a task run via [gio.task.Task.runInThread] or [gio.task.Task.runInThreadSync], calling this method will save result to be returned to the caller later, but the task will not actually be completed until the #GTaskThreadFunc exits.
Note that since the task may be completed before returning from [gio.task.Task.returnPointer], you cannot assume that result is still valid after calling this, unless you are still holding another reference on it.
Parameters
result | the pointer result of a task function |
resultDestroy | a #GDestroyNotify function. |