[telepathy-gabble/master] Make sure we only call the callback if it's still alive

Sjoerd Simons sjoerd.simons at collabora.co.uk
Fri Dec 18 06:28:02 PST 2009


---
 src/bytestream-factory.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/bytestream-factory.c b/src/bytestream-factory.c
index 908c6f9..acdad38 100644
--- a/src/bytestream-factory.c
+++ b/src/bytestream-factory.c
@@ -2121,19 +2121,18 @@ streaminit_reply_cb (GabbleConnection *conn,
 END:
   if (!success && bytestream != NULL)
     {
-      /* Initiation failed. We remove the stream */
       remove_bytestream (self, bytestream);
       bytestream = NULL;
     }
 
   /* user callback */
-  data->func (bytestream, (const gchar*) data->stream_id, reply_msg,
-      data->object, data->user_data);
+  if (data->object_alive)
+    data->func (bytestream, (const gchar*) data->stream_id, reply_msg,
+        data->object, data->user_data);
 
   if (peer_resource != NULL)
     g_free (peer_resource);
 
-
   if (peer_handle != 0)
     tp_handle_unref (contact_repo, peer_handle);
 
-- 
1.5.6.5




More information about the telepathy-commits mailing list