[telepathy-gabble/master] Explain a surprising g_object_unref

Will Thompson will.thompson at collabora.co.uk
Wed May 6 04:00:44 PDT 2009


---
 src/media-channel.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/media-channel.c b/src/media-channel.c
index 4ca5840..0e98281 100644
--- a/src/media-channel.c
+++ b/src/media-channel.c
@@ -2793,6 +2793,12 @@ gabble_media_channel_error (TpSvcMediaSessionHandler *iface,
 
   g_assert (priv->streams != NULL);
 
+  /* Calling gabble_media_stream_error () on all the streams will ultimately
+   * cause them all to emit 'closed'. In response to 'closed', stream_close_cb
+   * normally unrefs them, and removes them from priv->streams. We're iterating
+   * across priv->streams here, so we don't want it to be modified from
+   * underneath us. So, we move it aside, and unref each stream here.
+   */
   tmp = priv->streams;
   priv->streams = NULL;
 
-- 
1.5.6.5




More information about the telepathy-commits mailing list