[glib] doc: fix g_task_attach_source() example
- From: Daiki Ueno <dueno src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] doc: fix g_task_attach_source() example
- Date: Mon, 2 Nov 2015 02:14:19 +0000 (UTC)
commit 863bffdac7f08815e4189bc881cb0c26d98d96c3
Author: Daiki Ueno <dueno src gnome org>
Date: Mon Nov 2 09:38:50 2015 +0900
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
gio/gtask.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/gio/gtask.c b/gio/gtask.c
index 2e99e12..4219be0 100644
--- a/gio/gtask.c
+++ b/gio/gtask.c
@@ -198,7 +198,7 @@
* g_object_unref (task);
* }
*
- * static void
+ * static gboolean
* decorator_ready (gpointer user_data)
* {
* GTask *task = user_data;
@@ -207,6 +207,8 @@
* cake_decorate_async (bd->cake, bd->frosting, bd->message,
* g_task_get_cancellable (task),
* decorated_cb, task);
+ *
+ * return G_SOURCE_REMOVE;
* }
*
* static void
@@ -243,8 +245,7 @@
* source = cake_decorator_wait_source_new (cake);
* // Attach @source to @task's GMainContext and have it call
* // decorator_ready() when it is ready.
- * g_task_attach_source (task, source,
- * G_CALLBACK (decorator_ready));
+ * g_task_attach_source (task, source, decorator_ready);
* g_source_unref (source);
* }
* }
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]