[Telepathy-commits] [telepathy-gabble/master] unref activity ref when destroying pep and invited hash tables

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Mon Sep 29 10:27:55 PDT 2008


---
 src/conn-olpc.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/src/conn-olpc.c b/src/conn-olpc.c
index 67e15d5..7926e31 100644
--- a/src/conn-olpc.c
+++ b/src/conn-olpc.c
@@ -3711,12 +3711,31 @@ conn_olpc_activity_properties_init (GabbleConnection *conn)
       G_CALLBACK (connection_presences_updated_cb), conn);
 }
 
+static void
+unref_activities_in_each_set (TpHandle handle,
+                            TpHandleSet *set,
+                            GabbleConnection *conn)
+{
+  if (set != NULL)
+    {
+      tp_handle_set_foreach (set,
+          decrement_contacts_activities_set_foreach, conn);
+    }
+}
+
 void
 conn_olpc_activity_properties_dispose (GabbleConnection *self)
 {
   g_hash_table_destroy (self->olpc_current_act);
+
+  g_hash_table_foreach (self->olpc_pep_activities,
+      (GHFunc) unref_activities_in_each_set, self);
   g_hash_table_destroy (self->olpc_pep_activities);
+
+  g_hash_table_foreach (self->olpc_invited_activities,
+      (GHFunc) unref_activities_in_each_set, self);
   g_hash_table_destroy (self->olpc_invited_activities);
+
   g_hash_table_destroy (self->olpc_views);
   g_hash_table_destroy (self->olpc_activities_info);
 }
-- 
1.5.6.5




More information about the Telepathy-commits mailing list