diff options
author | Xavier Claessens <xclaesse@src.gnome.org> | 2009-01-15 18:28:03 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2009-01-15 18:28:03 +0800 |
commit | 811058b7e0803da92939291021bc9af23aab609a (patch) | |
tree | 3f432416d2da59e790efbb5950330bcd82c5245d /libempathy/empathy-tp-call.c | |
parent | bd286658b0d4a9258dac573da710522021197222 (diff) | |
download | gsoc2013-empathy-811058b7e0803da92939291021bc9af23aab609a.tar gsoc2013-empathy-811058b7e0803da92939291021bc9af23aab609a.tar.gz gsoc2013-empathy-811058b7e0803da92939291021bc9af23aab609a.tar.bz2 gsoc2013-empathy-811058b7e0803da92939291021bc9af23aab609a.tar.lz gsoc2013-empathy-811058b7e0803da92939291021bc9af23aab609a.tar.xz gsoc2013-empathy-811058b7e0803da92939291021bc9af23aab609a.tar.zst gsoc2013-empathy-811058b7e0803da92939291021bc9af23aab609a.zip |
Do not unref the channel when closing it, wait for the invalidated signal.
svn path=/trunk/; revision=2230
Diffstat (limited to 'libempathy/empathy-tp-call.c')
-rw-r--r-- | libempathy/empathy-tp-call.c | 36 |
1 files changed, 12 insertions, 24 deletions
diff --git a/libempathy/empathy-tp-call.c b/libempathy/empathy-tp-call.c index 3160d3a14..b01db859d 100644 --- a/libempathy/empathy-tp-call.c +++ b/libempathy/empathy-tp-call.c @@ -370,23 +370,6 @@ tp_call_async_cb (TpProxy *proxy, } static void -tp_call_close_channel (EmpathyTpCall *call) -{ - EmpathyTpCallPriv *priv = GET_PRIV (call); - - if (priv->status == EMPATHY_TP_CALL_STATUS_CLOSED) - return; - - DEBUG ("Closing channel"); - - tp_cli_channel_call_close (priv->channel, -1, - NULL, NULL, NULL, NULL); - - priv->status = EMPATHY_TP_CALL_STATUS_CLOSED; - g_object_notify (G_OBJECT (call), "status"); -} - -static void tp_call_stream_engine_invalidated_cb (TpProxy *stream_engine, GQuark domain, gint code, @@ -394,7 +377,7 @@ tp_call_stream_engine_invalidated_cb (TpProxy *stream_engine, EmpathyTpCall *call) { DEBUG ("Stream engine proxy invalidated: %s", message); - tp_call_close_channel (call); + empathy_tp_call_close (call); } static void @@ -414,7 +397,7 @@ tp_call_stream_engine_watch_name_owner_cb (TpDBusDaemon *daemon, if (priv->stream_engine_running && G_STR_EMPTY (new_owner)) { DEBUG ("Stream engine falled off the bus"); - tp_call_close_channel (call); + empathy_tp_call_close (call); return; } @@ -695,13 +678,18 @@ empathy_tp_call_close (EmpathyTpCall *call) { EmpathyTpCallPriv *priv = GET_PRIV (call); - g_signal_handlers_disconnect_by_func (priv->channel, - tp_call_channel_invalidated_cb, call); + g_return_if_fail (EMPATHY_IS_TP_CALL (call)); - tp_call_close_channel (call); + if (priv->status == EMPATHY_TP_CALL_STATUS_CLOSED) + return; - g_object_unref (priv->channel); - priv->channel = NULL; + DEBUG ("Closing channel"); + + tp_cli_channel_call_close (priv->channel, -1, + NULL, NULL, NULL, NULL); + + priv->status = EMPATHY_TP_CALL_STATUS_CLOSED; + g_object_notify (G_OBJECT (call), "status"); } void |