]> git.0d.be Git - empathy.git/commitdiff
empathy_roster_model_get_groups_for_individual: return a (transfer full) list
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 12 Sep 2012 11:12:51 +0000 (13:12 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Wed, 12 Sep 2012 12:15:02 +0000 (14:15 +0200)
gee_iterator_get() returns a new string, so we have to pass its ownership to
the list to not leak it.

https://bugzilla.gnome.org/show_bug.cgi?id=683864

libempathy-gtk/empathy-roster-model-manager.c
libempathy-gtk/empathy-roster-model.c
libempathy-gtk/empathy-roster-view.c

index 74789c7a536137918167c6f4d3336a1f239baf33..3738c7fcd6ddfbf37d2776fadfd45ac0a872344b 100644 (file)
@@ -373,14 +373,14 @@ empathy_roster_model_manager_get_groups_for_individual (
   if (is_xmpp_local_contact (individual))
     {
       groups_list = g_list_prepend (groups_list,
-          EMPATHY_ROSTER_MODEL_GROUP_PEOPLE_NEARBY);
+          g_strdup (EMPATHY_ROSTER_MODEL_GROUP_PEOPLE_NEARBY));
       return groups_list;
     }
 
   if (individual_in_top_group_members (EMPATHY_ROSTER_MODEL_MANAGER (model),
           individual))
     groups_list = g_list_prepend (groups_list,
-        EMPATHY_ROSTER_MODEL_GROUP_TOP_GROUP);
+        g_strdup (EMPATHY_ROSTER_MODEL_GROUP_TOP_GROUP));
 
   groups_set = folks_group_details_get_groups (
       FOLKS_GROUP_DETAILS (individual));
index 269aba243311440d9b1daf56e03d77b442fef729..a7f094e3ff2f5e970df43260a4b24cab9726d2ad 100644 (file)
@@ -119,7 +119,7 @@ empathy_roster_model_get_individuals (EmpathyRosterModel *self)
  *
  * Returns the groups of which @individual is a member of.
  *
- * Returns: (transfer container): a #GList of (const gchar *) representing the
+ * Returns: (transfer full): a #GList of (gchar *) representing the
  * groups of @individual
  */
 GList *
index d1e1c7891cd74acfd1ef0980c1813fbebf1e7da0..b5f2ccd074fd42840c1c21064534a93dc5562b6b 100644 (file)
@@ -409,7 +409,7 @@ individual_added (EmpathyRosterView *self,
           add_to_group (self, individual, EMPATHY_ROSTER_MODEL_GROUP_UNGROUPED);
         }
 
-      g_list_free (groups);
+      g_list_free_full (groups, g_free);
     }
 
   tp_g_signal_connect_object (individual, "notify::is-favourite",
@@ -595,7 +595,7 @@ contact_in_top (EmpathyRosterView *self,
             (GCompareFunc) g_strcmp0) != NULL)
         result = TRUE;
 
-      g_list_free (groups);
+      g_list_free_full (groups, g_free);
 
       return result;
     }