+2005-05-06 Sushma Rai <rsushma@novell.com>
+
+ * libedata-book/e-book-backend-cache.c
+ (e_book_backend_cache_get_contacts): Freeing the list of cache objects
+ and sexp.
+ (e_book_backend_cache_search): Freeing list of contacts matching the
+ query.
+
2005-05-04 Hans Petter Jansson <hpj@novell.com>
* libebook/e-address-western.c:
EContact *contact;
EBookBackendSExp *sexp = NULL;
const char *uid;
+
g_return_val_if_fail (E_IS_BOOK_BACKEND_CACHE (cache), NULL);
if (query) {
sexp = e_book_backend_sexp_new (query);
l = e_file_cache_get_objects (E_FILE_CACHE (cache));
- if (!l)
- return NULL;
+
for ( ; l != NULL; l = g_slist_next (l)) {
vcard_str = l->data;
if (vcard_str && !strncmp (vcard_str, "BEGIN:VCARD", 11)) {
}
}
+ if (l)
+ g_slist_free (l);
+ if (sexp)
+ g_object_unref (sexp);
return list;
}
ptr_array = g_ptr_array_new ();
temp = matching_contacts;
- for (; matching_contacts != NULL; matching_contacts = g_list_next (matching_contacts))
+ for (; matching_contacts != NULL; matching_contacts = g_list_next (matching_contacts)) {
g_ptr_array_add (ptr_array, e_contact_get (matching_contacts->data, E_CONTACT_UID));
-
- return ptr_array;
+ g_object_unref (matching_contacts->data);
+ }
+ g_list_free (temp);
-
+ return ptr_array;
}
gboolean