aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-09-10 17:14:22 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-09-11 16:09:25 +0800
commite4d1085846020f3522f94e1cb075b7d9417b9cea (patch)
treeefaed600fa9262ffb7604456c3ca9cc374f73175 /libempathy-gtk
parent3ef4a79d48375e55d0ea8baafa992971c2982885 (diff)
downloadgsoc2013-empathy-e4d1085846020f3522f94e1cb075b7d9417b9cea.tar
gsoc2013-empathy-e4d1085846020f3522f94e1cb075b7d9417b9cea.tar.gz
gsoc2013-empathy-e4d1085846020f3522f94e1cb075b7d9417b9cea.tar.bz2
gsoc2013-empathy-e4d1085846020f3522f94e1cb075b7d9417b9cea.tar.lz
gsoc2013-empathy-e4d1085846020f3522f94e1cb075b7d9417b9cea.tar.xz
gsoc2013-empathy-e4d1085846020f3522f94e1cb075b7d9417b9cea.tar.zst
gsoc2013-empathy-e4d1085846020f3522f94e1cb075b7d9417b9cea.zip
roster-view: clear the view when disposing
https://bugzilla.gnome.org/show_bug.cgi?id=683699
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-roster-view.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/libempathy-gtk/empathy-roster-view.c b/libempathy-gtk/empathy-roster-view.c
index 8c2c277b6..a5d145943 100644
--- a/libempathy-gtk/empathy-roster-view.c
+++ b/libempathy-gtk/empathy-roster-view.c
@@ -1046,12 +1046,27 @@ empathy_roster_view_constructed (GObject *object)
}
static void
+clear_view (EmpathyRosterView *self)
+{
+ 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);
+}
+
+static void
empathy_roster_view_dispose (GObject *object)
{
EmpathyRosterView *self = EMPATHY_ROSTER_VIEW (object);
void (*chain_up) (GObject *) =
((GObjectClass *) empathy_roster_view_parent_class)->dispose;
+ /* Start by clearing the view so our internal hash tables are cleared from
+ * objects being destroyed. */
+ clear_view (self);
+
stop_flashing (self);
empathy_roster_view_set_live_search (self, NULL);
@@ -1377,17 +1392,6 @@ empathy_roster_view_show_offline (EmpathyRosterView *self,
g_object_notify (G_OBJECT (self), "show-offline");
}
-static void
-clear_view (EmpathyRosterView *self)
-{
- 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
empathy_roster_view_show_groups (EmpathyRosterView *self,
gboolean show)