doc: fix g_task_attach_source() example

The 3rd argument of the function is not a GCallback, but a GSourceFunc.

https://bugzilla.gnome.org/show_bug.cgi?id=757451
This commit is contained in:
Daiki Ueno 2015-11-02 09:38:50 +09:00
parent df352203d6
commit 863bffdac7

View File

@ -198,7 +198,7 @@
* g_object_unref (task); * g_object_unref (task);
* } * }
* *
* static void * static gboolean
* decorator_ready (gpointer user_data) * decorator_ready (gpointer user_data)
* { * {
* GTask *task = user_data; * GTask *task = user_data;
@ -207,6 +207,8 @@
* cake_decorate_async (bd->cake, bd->frosting, bd->message, * cake_decorate_async (bd->cake, bd->frosting, bd->message,
* g_task_get_cancellable (task), * g_task_get_cancellable (task),
* decorated_cb, task); * decorated_cb, task);
*
* return G_SOURCE_REMOVE;
* } * }
* *
* static void * static void
@ -243,8 +245,7 @@
* source = cake_decorator_wait_source_new (cake); * source = cake_decorator_wait_source_new (cake);
* // Attach @source to @task's GMainContext and have it call * // Attach @source to @task's GMainContext and have it call
* // decorator_ready() when it is ready. * // decorator_ready() when it is ready.
* g_task_attach_source (task, source, * g_task_attach_source (task, source, decorator_ready);
* G_CALLBACK (decorator_ready));
* g_source_unref (source); * g_source_unref (source);
* } * }
* } * }