[glib] gsocket: Document that g_socket_create_source() holds a socket ref
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] gsocket: Document that g_socket_create_source() holds a socket ref
- Date: Mon, 23 Jun 2014 15:25:07 +0000 (UTC)
commit 00e733315de2c2588b0b5b95e02fcd29bb259cb1
Author: Philip Withnall <philip withnall collabora co uk>
Date: Mon Jun 23 10:12:08 2014 +0100
gsocket: Document that g_socket_create_source() holds a socket ref
This is quite important, as it means you can safely let the GSocket drop
out of scope while maintaining a reference to the GSource, and the
socket will remain open. That means fewer closure structures, simpler
code, and fewer allocations.
https://bugzilla.gnome.org/show_bug.cgi?id=732081
gio/gsocket.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gio/gsocket.c b/gio/gsocket.c
index e59ace8..a233260 100644
--- a/gio/gsocket.c
+++ b/gio/gsocket.c
@@ -3385,8 +3385,9 @@ socket_source_new (GSocket *socket,
* @condition: a #GIOCondition mask to monitor
* @cancellable: (allow-none): a %GCancellable or %NULL
*
- * Creates a %GSource that can be attached to a %GMainContext to monitor
- * for the availability of the specified @condition on the socket.
+ * Creates a #GSource that can be attached to a %GMainContext to monitor
+ * for the availability of the specified @condition on the socket. The #GSource
+ * keeps a reference to the @socket.
*
* The callback on the source is of the #GSocketSourceFunc type.
*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]