[Telepathy-commits] [telepathy-gabble/master] activity_disposed_cb: check if the olpc_activities_info hash tables was not already destroyed

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Thu Oct 9 08:02:46 PDT 2008


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

diff --git a/src/conn-olpc.c b/src/conn-olpc.c
index 8a8c289..8a42f76 100644
--- a/src/conn-olpc.c
+++ b/src/conn-olpc.c
@@ -643,6 +643,10 @@ activity_disposed_cb (gpointer _conn,
 {
   GabbleConnection *conn = GABBLE_CONNECTION (_conn);
 
+  if (conn->olpc_activities_info == NULL)
+    /* We are disposing */
+    return;
+
   g_hash_table_foreach_remove (conn->olpc_activities_info,
       remove_activity, activity);
 }
@@ -3669,16 +3673,20 @@ void
 conn_olpc_activity_properties_dispose (GabbleConnection *self)
 {
   g_hash_table_destroy (self->olpc_current_act);
+  self->olpc_current_act = NULL;
 
   g_hash_table_foreach (self->olpc_pep_activities,
       (GHFunc) unref_activities_in_each_set, self);
   g_hash_table_destroy (self->olpc_pep_activities);
+  self->olpc_pep_activities = NULL;
 
   g_hash_table_foreach (self->olpc_invited_activities,
       (GHFunc) unref_activities_in_each_set, self);
   g_hash_table_destroy (self->olpc_invited_activities);
+  self->olpc_invited_activities = NULL;
 
   g_hash_table_destroy (self->olpc_activities_info);
+  self->olpc_activities_info = NULL;
 }
 
 void
-- 
1.5.6.5




More information about the Telepathy-commits mailing list