]> git.0d.be Git - empathy.git/commitdiff
roster-view: clear_view: start by cleaning our internal hash tables
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 3 Sep 2012 15:09:55 +0000 (17:09 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 3 Sep 2012 15:12:56 +0000 (17:12 +0200)
Removing and destroying the widgets contained in the view will call
empathy_roster_view_remove(). This function may use some of the internal hash
tables which now contain destroyed object.

It's safer to clean the internal hash tables first as we are about to destroy
their content anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=683275

libempathy-gtk/empathy-roster-view.c

index 205b11a664985991b634ce24521137b6aaf5b248..557728527900b52cee7bd7ea7059be0edf71c4cd 100644 (file)
@@ -1337,12 +1337,12 @@ empathy_roster_view_show_offline (EmpathyRosterView *self,
 static void
 clear_view (EmpathyRosterView *self)
 {
-  gtk_container_foreach (GTK_CONTAINER (self),
-      (GtkCallback) gtk_widget_destroy, NULL);
-
   g_hash_table_remove_all (self->priv->roster_contacts);
   g_hash_table_remove_all (self->priv->roster_groups);
   g_hash_table_remove_all (self->priv->displayed_contacts);
+
+  gtk_container_foreach (GTK_CONTAINER (self),
+      (GtkCallback) gtk_widget_destroy, NULL);
 }
 
 void