summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChandni Verma <chandniverma2112@gmail.com>2013-08-14 06:48:13 (GMT)
committerChandni Verma <chandniverma2112@gmail.com>2013-08-14 12:03:38 (GMT)
commit2088b62035060aa42cc52bca7c3b1f6609751c32 (patch)
tree60f74ca1c1e5d4a02eb09e6283581d5beb09d2b2
parent083966864e828b6c226285ac833a2179df9bb6f9 (diff)
downloadempathy-2088b62035060aa42cc52bca7c3b1f6609751c32.tar.gz
empathy-2088b62035060aa42cc52bca7c3b1f6609751c32.tar.xz
Make individual_store_find_contact and free_iters protected
https://bugzilla.gnome.org/show_bug.cgi?id=703487
-rw-r--r--libempathy-gtk/empathy-individual-store.c21
-rw-r--r--libempathy-gtk/empathy-individual-store.h5
2 files changed, 16 insertions, 10 deletions
diff --git a/libempathy-gtk/empathy-individual-store.c b/libempathy-gtk/empathy-individual-store.c
index 3ebe35a..1fc0076 100644
--- a/libempathy-gtk/empathy-individual-store.c
+++ b/libempathy-gtk/empathy-individual-store.c
@@ -199,8 +199,9 @@ individual_store_get_group (EmpathyIndividualStore *self,
}
}
-static GList *
-individual_store_find_contact (EmpathyIndividualStore *self,
+GList *
+/* (transfer full) free with empathy_individual_store_free_iters() */
+empathy_individual_store_find_contact (EmpathyIndividualStore *self,
FolksIndividual *individual)
{
GQueue *row_refs_queue;
@@ -222,8 +223,8 @@ individual_store_find_contact (EmpathyIndividualStore *self,
return iters_list;
}
-static void
-free_iters (GList *iters)
+void
+empathy_individual_store_free_iters (GList *iters)
{
g_list_foreach (iters, (GFunc) gtk_tree_iter_free, NULL);
g_list_free (iters);
@@ -386,7 +387,7 @@ individual_store_contact_set_active (EmpathyIndividualStore *self,
model = GTK_TREE_MODEL (self);
- iters = individual_store_find_contact (self, individual);
+ iters = empathy_individual_store_find_contact (self, individual);
for (l = iters; l; l = l->next)
{
GtkTreePath *path;
@@ -403,7 +404,7 @@ individual_store_contact_set_active (EmpathyIndividualStore *self,
}
}
- free_iters (iters);
+ empathy_individual_store_free_iters (iters);
}
static void individual_store_contact_active_free (ShowActiveData *data);
@@ -521,7 +522,7 @@ individual_avatar_pixbuf_received_cb (FolksIndividual *individual,
{
GList *iters, *l;
- iters = individual_store_find_contact (data->store, individual);
+ iters = empathy_individual_store_find_contact (data->store, individual);
for (l = iters; l; l = l->next)
{
gtk_tree_store_set (GTK_TREE_STORE (data->store), l->data,
@@ -529,7 +530,7 @@ individual_avatar_pixbuf_received_cb (FolksIndividual *individual,
-1);
}
- free_iters (iters);
+ empathy_individual_store_free_iters (iters);
}
/* Free things */
@@ -566,7 +567,7 @@ individual_store_contact_update (EmpathyIndividualStore *self,
model = GTK_TREE_MODEL (self);
- iters = individual_store_find_contact (self, individual);
+ iters = empathy_individual_store_find_contact (self, individual);
if (!iters)
{
in_list = FALSE;
@@ -694,7 +695,7 @@ individual_store_contact_update (EmpathyIndividualStore *self,
* timeout removes the user from the contact list, really we
* should remove the first timeout.
*/
- free_iters (iters);
+ empathy_individual_store_free_iters (iters);
}
static void
diff --git a/libempathy-gtk/empathy-individual-store.h b/libempathy-gtk/empathy-individual-store.h
index 402f451..c709348 100644
--- a/libempathy-gtk/empathy-individual-store.h
+++ b/libempathy-gtk/empathy-individual-store.h
@@ -145,6 +145,11 @@ void individual_store_remove_individual_and_disconnect (
/* protected */
+GList *empathy_individual_store_find_contact (EmpathyIndividualStore *self,
+ FolksIndividual *individual);
+
+void empathy_individual_store_free_iters (GList *iters);
+
void empathy_individual_store_disconnect_individual (
EmpathyIndividualStore *self,
FolksIndividual *individual);