diff options
author | Chandni Verma <chandniverma2112@gmail.com> | 2013-08-14 14:48:13 +0800 |
---|---|---|
committer | Chandni Verma <chandniverma2112@gmail.com> | 2013-08-14 20:03:38 +0800 |
commit | 2088b62035060aa42cc52bca7c3b1f6609751c32 (patch) | |
tree | 60f74ca1c1e5d4a02eb09e6283581d5beb09d2b2 /libempathy-gtk | |
parent | 083966864e828b6c226285ac833a2179df9bb6f9 (diff) | |
download | gsoc2013-empathy-2088b62035060aa42cc52bca7c3b1f6609751c32.tar gsoc2013-empathy-2088b62035060aa42cc52bca7c3b1f6609751c32.tar.gz gsoc2013-empathy-2088b62035060aa42cc52bca7c3b1f6609751c32.tar.bz2 gsoc2013-empathy-2088b62035060aa42cc52bca7c3b1f6609751c32.tar.lz gsoc2013-empathy-2088b62035060aa42cc52bca7c3b1f6609751c32.tar.xz gsoc2013-empathy-2088b62035060aa42cc52bca7c3b1f6609751c32.tar.zst gsoc2013-empathy-2088b62035060aa42cc52bca7c3b1f6609751c32.zip |
Make individual_store_find_contact and free_iters protected
https://bugzilla.gnome.org/show_bug.cgi?id=703487
Diffstat (limited to 'libempathy-gtk')
-rw-r--r-- | libempathy-gtk/empathy-individual-store.c | 21 | ||||
-rw-r--r-- | libempathy-gtk/empathy-individual-store.h | 5 |
2 files changed, 16 insertions, 10 deletions
diff --git a/libempathy-gtk/empathy-individual-store.c b/libempathy-gtk/empathy-individual-store.c index 3ebe35a6b..1fc0076a5 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 402f451b8..c709348fc 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); |