[telepathy-gabble/master] gabble_bytestream_factory_dispose: disconnect signals on bytestreams
Guillaume Desmottes
guillaume.desmottes at collabora.co.uk
Fri Apr 3 09:25:41 PDT 2009
---
src/bytestream-factory.c | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/src/bytestream-factory.c b/src/bytestream-factory.c
index 9973279..3622779 100644
--- a/src/bytestream-factory.c
+++ b/src/bytestream-factory.c
@@ -212,6 +212,21 @@ gabble_bytestream_factory_constructor (GType type,
}
static void
+disconnect_all_bytestreams (GabbleBytestreamFactory *self,
+ GHashTable *bytestreams)
+{
+ GHashTableIter iter;
+ gpointer bytestream;
+
+ g_hash_table_iter_init (&iter, bytestreams);
+ while (g_hash_table_iter_next (&iter, NULL, &bytestream))
+ {
+ g_signal_handlers_disconnect_matched (bytestream, G_SIGNAL_MATCH_DATA,
+ 0, 0, NULL, NULL, self);
+ }
+}
+
+static void
gabble_bytestream_factory_dispose (GObject *object)
{
GabbleBytestreamFactory *self = GABBLE_BYTESTREAM_FACTORY (object);
@@ -240,15 +255,19 @@ gabble_bytestream_factory_dispose (GObject *object)
priv->iq_socks5_cb, LM_MESSAGE_TYPE_IQ);
lm_message_handler_unref (priv->iq_socks5_cb);
+ disconnect_all_bytestreams (self, priv->ibb_bytestreams);
g_hash_table_destroy (priv->ibb_bytestreams);
priv->ibb_bytestreams = NULL;
+ disconnect_all_bytestreams (self, priv->muc_bytestreams);
g_hash_table_destroy (priv->muc_bytestreams);
priv->muc_bytestreams = NULL;
+ disconnect_all_bytestreams (self, priv->socks5_bytestreams);
g_hash_table_destroy (priv->socks5_bytestreams);
priv->socks5_bytestreams = NULL;
+ disconnect_all_bytestreams (self, priv->multiple_bytestreams);
g_hash_table_destroy (priv->multiple_bytestreams);
priv->multiple_bytestreams = NULL;
--
1.5.6.5
More information about the telepathy-commits
mailing list