]> git.0d.be Git - empathy.git/blobdiff - libempathy/empathy-individual-manager.c
Merge branch 'gnome-3-8'
[empathy.git] / libempathy / empathy-individual-manager.c
index 8d14cdf0d7736d3755639af360a4ceb469f258fc..71960b5d2887d409a2049a689561b35721870d67 100644 (file)
  *          Travis Reitter <travis.reitter@collabora.co.uk>
  */
 
-#include <config.h>
-
-#include <string.h>
-
-#include <telepathy-glib/telepathy-glib.h>
-
-#include <folks/folks.h>
-#include <folks/folks-telepathy.h>
-
-#include <extensions/extensions.h>
-
+#include "config.h"
 #include "empathy-individual-manager.h"
+
 #include "empathy-utils.h"
 
 #define DEBUG_FLAG EMPATHY_DEBUG_CONTACT
@@ -289,8 +280,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,