[empathy] roster-view: clear_view: start by cleaning our internal hash tables



commit d25442bccc9b9d143fe92f2506f6d84499ece829
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Mon Sep 3 17:09:55 2012 +0200

    roster-view: clear_view: start by cleaning our internal hash tables
    
    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 |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/libempathy-gtk/empathy-roster-view.c b/libempathy-gtk/empathy-roster-view.c
index 205b11a..5577285 100644
--- a/libempathy-gtk/empathy-roster-view.c
+++ b/libempathy-gtk/empathy-roster-view.c
@@ -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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]