unref op->view. (pas_backend_ldap_process_create_card): ref op->view.

2001-10-15  Chris Toshok  <toshok@ximian.com>

	* backend/pas/pas-backend-ldap.c (create_card_dtor): unref
	op->view.
	(pas_backend_ldap_process_create_card): ref op->view.
	(remove_card_dtor): unref op->view.
	(pas_backend_ldap_process_remove_card): ref op->view.
	(modify_card_dtor): unref op->view.
	(pas_backend_ldap_process_modify_card): ref op->view.
	(ldap_search_dtor): unref op->view.
	(pas_backend_ldap_search): ref op->view.

svn path=/trunk/; revision=13690
This commit is contained in:
Chris Toshok
2001-10-15 23:13:52 +00:00
committed by Chris Toshok
parent 4bcda57628
commit 31c4879563
2 changed files with 39 additions and 3 deletions

View File

@ -1,5 +1,17 @@
2001-10-15 Chris Toshok <toshok@ximian.com>
* backend/pas/pas-backend-ldap.c (create_card_dtor): unref
op->view.
(pas_backend_ldap_process_create_card): ref op->view.
(remove_card_dtor): unref op->view.
(pas_backend_ldap_process_remove_card): ref op->view.
(modify_card_dtor): unref op->view.
(pas_backend_ldap_process_modify_card): ref op->view.
(ldap_search_dtor): unref op->view.
(pas_backend_ldap_search): ref op->view.
2001-10-15 Chris Toshok <toshok@ximian.com>
* backend/pas/pas-backend-ldap.c
(pas_backend_ldap_process_get_book_view): make sure to unref the
book_view here so we don't leak them.

View File

@ -508,6 +508,7 @@ do_create(PASBackend *backend,
}
else {
g_free (id);
ret_val = NULL;
}
@ -575,8 +576,20 @@ pas_backend_file_process_remove_card (PASBackend *backend,
int db_error;
EIterator *iterator;
char *vcard_string;
const char *id;
string_to_dbt (req->id, &id_dbt);
/* This is disgusting, but for a time cards were added with
ID's that are no longer used (they contained both the uri
and the id.) If we recognize it as a uri (file:///...) trim
off everything before the last '/', and use that as the
id.*/
if (!strncmp (req->id, "file:///", strlen ("file:///"))) {
id = strrchr (req->id, '/') + 1;
}
else
id = req->id;
string_to_dbt (id, &id_dbt);
memset (&vcard_dbt, 0, sizeof (vcard_dbt));
db_error = db->get (db, NULL, &id_dbt, &vcard_dbt, 0);
@ -632,14 +645,25 @@ pas_backend_file_process_modify_card (PASBackend *backend,
int db_error;
EIterator *iterator;
ECard *card;
const char *id;
const char *id, *lookup_id;
char *old_vcard_string;
/* create a new ecard from the request data */
card = e_card_new(req->vcard);
id = e_card_get_id(card);
string_to_dbt (id, &id_dbt);
/* This is disgusting, but for a time cards were added with
ID's that are no longer used (they contained both the uri
and the id.) If we recognize it as a uri (file:///...) trim
off everything before the last '/', and use that as the
id.*/
if (!strncmp (id, "file:///", strlen ("file:///"))) {
lookup_id = strrchr (id, '/') + 1;
}
else
lookup_id = id;
string_to_dbt (lookup_id, &id_dbt);
memset (&vcard_dbt, 0, sizeof (vcard_dbt));
/* get the old ecard - the one that's presently in the db */