]> git.0d.be Git - empathy.git/commitdiff
individual-manager: make sure the individual stays alive when removing it
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 2 Oct 2012 11:31:10 +0000 (13:31 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Tue, 2 Oct 2012 11:58:38 +0000 (13:58 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=685203

libempathy/empathy-individual-manager.c

index 8d14cdf0d7736d3755639af360a4ceb469f258fc..57815e13e41f08628f58a88a07d2b1945d07f4c4 100644 (file)
@@ -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,