[Telepathy-commits] [telepathy-gabble/master] GabbleOlpcGadgetManager: fix a double free in _dispose

Alban Crequy alban.crequy at collabora.co.uk
Thu Nov 27 10:52:01 PST 2008


---
 src/olpc-gadget-manager.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/olpc-gadget-manager.c b/src/olpc-gadget-manager.c
index 1665825..3be609e 100644
--- a/src/olpc-gadget-manager.c
+++ b/src/olpc-gadget-manager.c
@@ -89,10 +89,14 @@ gabble_olpc_gadget_manager_close_all (GabbleOlpcGadgetManager *self)
 {
   DEBUG ("%p", self);
 
+  /* Use a temporary variable because we don't want
+   * olpc_gadget_channel_closed_cb to remove the channel from the hash table a
+   * second time */
   if (self->priv->channels != NULL)
     {
-      g_hash_table_destroy (self->priv->channels);
+      GHashTable *tmp = self->priv->channels;
       self->priv->channels = NULL;
+      g_hash_table_destroy (tmp);
     }
 }
 
-- 
1.5.6.5




More information about the Telepathy-commits mailing list