]> git.0d.be Git - empathy.git/commitdiff
Only unref the EmpathyIndividualView after emptying the group hash table
authorPhilip Withnall <philip.withnall@collabora.co.uk>
Wed, 1 Sep 2010 17:38:42 +0000 (18:38 +0100)
committerPhilip Withnall <philip.withnall@collabora.co.uk>
Thu, 2 Sep 2010 09:21:45 +0000 (10:21 +0100)
Otherwise, unreffing the view could cause it to be destroyed, and thus
emptying the hash table will write into freed memory and crash.

libempathy-gtk/empathy-individual-view.c

index 05429d016b9975846ae17d430157e656d3eec23c..2f47f843cca6d209708b030e70922c936c6d45e9 100644 (file)
@@ -1503,13 +1503,12 @@ individual_view_expand_idle_cb (EmpathyIndividualView *self)
   g_signal_handlers_unblock_by_func (self,
       individual_view_row_expand_or_collapse_cb, GINT_TO_POINTER (TRUE));
 
-  priv->expand_groups_idle_handler = 0;
-  g_object_unref (self);
-
   /* Empty the table of groups to expand/contract, since it may contain groups
    * which no longer exist in the tree view. This can happen after going
    * offline, for example. */
   g_hash_table_remove_all (priv->expand_groups);
+  priv->expand_groups_idle_handler = 0;
+  g_object_unref (self);
 
   return FALSE;
 }