From 9a7ebcfed29a8bdb46c5d9a2032b14cc67e7ffdf Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Thu, 18 Oct 2012 10:42:36 +0200 Subject: empathy-call: Clean up the TfChannel before resetting the pipeline Fixes: https://bugzilla.gnome.org/686311 --- src/empathy-call-handler.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/empathy-call-handler.c b/src/empathy-call-handler.c index 3b870be07..63c4f48a3 100644 --- a/src/empathy-call-handler.c +++ b/src/empathy-call-handler.c @@ -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 -- cgit v1.2.3