From f72a036cce9ff7ce9d1e96f7c72e42e83c8c4452 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 2 Oct 2012 13:31:10 +0200 Subject: [PATCH] individual-manager: make sure the individual stays alive when removing it https://bugzilla.gnome.org/show_bug.cgi?id=685203 --- libempathy/empathy-individual-manager.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libempathy/empathy-individual-manager.c b/libempathy/empathy-individual-manager.c index 8d14cdf0..57815e13 100644 --- a/libempathy/empathy-individual-manager.c +++ b/libempathy/empathy-individual-manager.c @@ -289,8 +289,14 @@ remove_individual (EmpathyIndividualManager *self, FolksIndividual *individual) compare_individual_by_pop, NULL); if (iter != NULL) { + /* priv->top_individuals borrows its reference from + * priv->individuals_pop so we take a reference on the individual while + * removing it to make sure it stays alive while calling + * check_top_individuals(). */ + g_object_ref (individual); g_sequence_remove (iter); check_top_individuals (self); + g_object_unref (individual); } g_signal_handlers_disconnect_by_func (individual, -- 2.39.2