From 416fc11e36c34a4c7ea489a25904ac9c6df4bd78 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 1 Sep 2010 14:32:08 +0100 Subject: Remove the expand groups idle handler when destroying an EmpathyIndividualView This prevents the idle handler from being run after destruction and crashing due to referencing the EmpathyIndividualView's private memory which has already been freed. --- libempathy-gtk/empathy-individual-view.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libempathy-gtk') diff --git a/libempathy-gtk/empathy-individual-view.c b/libempathy-gtk/empathy-individual-view.c index 34032d651..05429d016 100644 --- a/libempathy-gtk/empathy-individual-view.c +++ b/libempathy-gtk/empathy-individual-view.c @@ -1503,8 +1503,8 @@ 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)); - g_object_unref (self); 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 @@ -1927,6 +1927,8 @@ individual_view_finalize (GObject *object) { EmpathyIndividualViewPriv *priv = GET_PRIV (object); + if (priv->expand_groups_idle_handler != 0) + g_source_remove (priv->expand_groups_idle_handler); g_hash_table_destroy (priv->expand_groups); G_OBJECT_CLASS (empathy_individual_view_parent_class)->finalize (object); -- cgit v1.2.3