]> git.0d.be Git - empathy.git/commitdiff
empathy-call: Clean up the TfChannel before resetting the pipeline
authorDebarshi Ray <debarshir@src.gnome.org>
Thu, 18 Oct 2012 08:42:36 +0000 (10:42 +0200)
committerDebarshi Ray <debarshir@src.gnome.org>
Thu, 18 Oct 2012 08:53:16 +0000 (10:53 +0200)
Fixes: https://bugzilla.gnome.org/686311
src/empathy-call-handler.c

index 3b870be07659d512d71c121467fb852f76471be1..63c4f48a381de9945528383efb252b4b8bb41ddd 100644 (file)
@@ -177,6 +177,20 @@ on_call_state_changed_cb (TpCallChannel *call,
 {
   EmpathyCallHandlerPriv *priv = handler->priv;
 
+  /* Clean up the TfChannel before bubbling the state-change signal
+   * further up. This ensures that the conference-removed signal is
+   * emitted before state-changed so that the client gets a chance
+   * to remove the conference from the pipeline before resetting the
+   * pipeline itself.
+   */
+  if (state == TP_CALL_STATE_ENDED)
+    {
+      tp_channel_close_async (TP_CHANNEL (call), NULL, NULL);
+      priv->accept_when_initialised = FALSE;
+      tp_clear_object (&priv->call);
+      tp_clear_object (&priv->tfchannel);
+    }
+
   g_signal_emit (handler, signals[STATE_CHANGED], 0, state,
       reason->dbus_reason);
 
@@ -186,14 +200,6 @@ on_call_state_changed_cb (TpCallChannel *call,
       tp_call_channel_accept_async (priv->call, on_call_accepted_cb, NULL);
       priv->accept_when_initialised = FALSE;
     }
-
-  if (state == TP_CALL_STATE_ENDED)
-    {
-      tp_channel_close_async (TP_CHANNEL (call), NULL, NULL);
-      priv->accept_when_initialised = FALSE;
-      tp_clear_object (&priv->call);
-      tp_clear_object (&priv->tfchannel);
-    }
 }
 
 static void