diff options
author | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2011-04-12 16:37:26 +0100 |
---|---|---|
committer | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2011-04-12 16:37:26 +0100 |
commit | 9e90ce65e26806bb3e142ddcccd889157c6958b0 (patch) | |
tree | c7698f5f8de272ca7bab1e8cc818e7fe3cd02540 /salut | |
parent | fb60933d6fa1511263c208468653cb7e8980fd86 (diff) |
message-channel: keep a ref to the channel when waiting for Request callback
And be sure to actually Close each channel when closing them all as
simply unreffing might not be enough.
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
Diffstat (limited to 'salut')
-rw-r--r-- | salut/channel-manager.c | 1 | ||||
-rw-r--r-- | salut/message-channel.c | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/salut/channel-manager.c b/salut/channel-manager.c index 125f6d0..15452bb 100644 --- a/salut/channel-manager.c +++ b/salut/channel-manager.c @@ -153,6 +153,7 @@ manager_close_all (YtstChannelManager *self) if (priv->channels != NULL) { DEBUG ("closing channels"); + g_queue_foreach (priv->channels, (GFunc) tp_base_channel_close, NULL); g_queue_foreach (priv->channels, (GFunc) g_object_unref, NULL); g_queue_free (priv->channels); priv->channels = NULL; diff --git a/salut/message-channel.c b/salut/message-channel.c index e8a4e68..52c5244 100644 --- a/salut/message-channel.c +++ b/salut/message-channel.c @@ -239,6 +239,8 @@ channel_message_stanza_callback (GObject *source_object, g_hash_table_destroy (attributes); g_free (body); } + + g_object_unref (self); } static void @@ -537,7 +539,7 @@ ytst_message_channel_request (TpYtsSvcChannel *channel, wocky_porter_send_iq_async (wocky_session_get_porter (session), priv->request, priv->cancellable, - channel_message_stanza_callback, self); + channel_message_stanza_callback, g_object_ref (self)); priv->requested = TRUE; tp_yts_svc_channel_return_from_request (context); |