[glib] Add comment about lifecycle issues for GIOStreams



commit 6d0bebb7df1129bb78cdd526e1b44c91b61321dd
Author: Alexander Larsson <alexl redhat com>
Date:   Tue May 12 19:31:19 2009 +0200

    Add comment about lifecycle issues for GIOStreams
---
 gio/giostream.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/gio/giostream.c b/gio/giostream.c
index 3d22bd7..6f3de48 100644
--- a/gio/giostream.c
+++ b/gio/giostream.c
@@ -47,6 +47,12 @@ G_DEFINE_TYPE (GIOStream, g_io_stream, G_TYPE_OBJECT);
  * To do the actual reading and writing you need to get the substreams
  * with g_io_stream_get_input_stream() and g_io_stream_get_output_stream().
  *
+ * The #GIOStream object owns the input and the output streams, not the other
+ * way around, so keeping the substreams alive will not keep the #GIOStream
+ * object alive. If the #GIOStream object is freed it will be closed, thus
+ * closing the substream, so even if the substreams stay alive they will
+ * always just return a %G_IO_ERROR_CLOSED for all operations.
+ *
  * To close a stream use g_io_stream_close() which will close the common
  * stream object and also the individual substreams. You can also close
  * the substreams themselves. In most cases this only marks the



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]