empathy r1089 - trunk/libempathy



Author: xclaesse
Date: Thu May  8 17:30:29 2008
New Revision: 1089
URL: http://svn.gnome.org/viewvc/empathy?rev=1089&view=rev

Log:
Ref the call object when emiting notify signals because signal handles could unref it


Modified:
   trunk/libempathy/empathy-tp-call.c

Modified: trunk/libempathy/empathy-tp-call.c
==============================================================================
--- trunk/libempathy/empathy-tp-call.c	(original)
+++ trunk/libempathy/empathy-tp-call.c	Thu May  8 17:30:29 2008
@@ -272,16 +272,18 @@
 {
   EmpathyTpCallPriv *priv = GET_PRIV (call);
 
+  g_object_ref (call);
   if (!priv->contact && !empathy_contact_is_user (contact))
     {
       priv->contact = g_object_ref (contact);
       priv->is_incoming = TRUE;
       priv->status = EMPATHY_TP_CALL_STATUS_PENDING;
       g_object_notify (G_OBJECT (call), "is-incoming");
-      g_object_notify (G_OBJECT (call), "contact"); 
-      g_object_notify (G_OBJECT (call), "status");	
+      g_object_notify (G_OBJECT (call), "contact");
+      g_object_notify (G_OBJECT (call), "status");
       tp_call_request_streams_for_capabilities (call,
           EMPATHY_CAPABILITIES_AUDIO);
+
     }
 
   if (priv->status == EMPATHY_TP_CALL_STATUS_PENDING &&
@@ -291,6 +293,7 @@
       priv->status = EMPATHY_TP_CALL_STATUS_ACCEPTED;
       g_object_notify (G_OBJECT (call), "status");
     }
+  g_object_unref (call);
 }
 
 static void
@@ -303,6 +306,7 @@
 {
   EmpathyTpCallPriv *priv = GET_PRIV (call);
 
+  g_object_ref (call);
   if (!priv->contact && !empathy_contact_is_user (contact))
     {
       priv->contact = g_object_ref (contact);
@@ -314,6 +318,7 @@
       tp_call_request_streams_for_capabilities (call,
           EMPATHY_CAPABILITIES_AUDIO);
     }
+  g_object_unref (call);
 }
 
 static void



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