diff options
author | JP Rosevear <jpr@ximian.com> | 2001-01-19 15:54:28 +0800 |
---|---|---|
committer | JP Rosevear <jpr@src.gnome.org> | 2001-01-19 15:54:28 +0800 |
commit | 86f07a3cd97dfda5abc2aa5eaf0bac556e8cf2a2 (patch) | |
tree | e32fb2c45d70401ad789e9675590bd671ea0849d /addressbook/conduit | |
parent | 3da36c62ad05875f71021f8933b6dc7cd3dd9826 (diff) | |
download | gsoc2013-evolution-86f07a3cd97dfda5abc2aa5eaf0bac556e8cf2a2.tar.gz gsoc2013-evolution-86f07a3cd97dfda5abc2aa5eaf0bac556e8cf2a2.tar.zst gsoc2013-evolution-86f07a3cd97dfda5abc2aa5eaf0bac556e8cf2a2.zip |
always free the delivery elements and correct embarrassingly stupid memory
2001-01-19 JP Rosevear <jpr@ximian.com>
* conduit/address-conduit.c (ecard_from_remote_record): always free
the delivery elements and correct embarrassingly stupid memory error
that was causing the addressbook conduit problems.
* backend/ebook/e-book-view-listener.c
(e_book_view_listener_check_queue): ref/unref ourself when processing
in case someone we signal unrefs us.
* conduit/address-conduit.c (sequence_complete): disconnect signals
when complete
svn path=/trunk/; revision=7641
Diffstat (limited to 'addressbook/conduit')
-rw-r--r-- | addressbook/conduit/address-conduit.c | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/addressbook/conduit/address-conduit.c b/addressbook/conduit/address-conduit.c index 43ba2569e0..ec0856bc5a 100644 --- a/addressbook/conduit/address-conduit.c +++ b/addressbook/conduit/address-conduit.c @@ -277,7 +277,7 @@ get_entry_text (struct Address address, int field) if (address.entry[field]) return e_pilot_utf8_from_pchar (address.entry[field]); - return strdup (""); + return g_strdup (""); } static void @@ -461,13 +461,13 @@ ecard_from_remote_record(EAddrConduitContext *ctxt, if (address.entry[entryTitle]) { char *txt = get_entry_text (address, entryTitle); e_card_simple_set(simple, E_CARD_SIMPLE_FIELD_TITLE, txt); - free (txt); + g_free (txt); } if (address.entry[entryCompany]) { char *txt = get_entry_text (address, entryCompany); e_card_simple_set(simple, E_CARD_SIMPLE_FIELD_ORG, txt); - free (txt); + g_free (txt); } /* Address */ @@ -482,28 +482,23 @@ ecard_from_remote_record(EAddrConduitContext *ctxt, if (address.entry[entryCountry]) delivery.country = get_entry_text (address, entryCountry); if (address.entry[entryZip]) - delivery.code = address.entry[entryZip]; + delivery.code = get_entry_text (address, entryZip); string = e_card_delivery_address_to_string (&delivery); e_card_simple_set (simple, E_CARD_SIMPLE_FIELD_ADDRESS_BUSINESS, string); g_free (string); - if (address.entry[entryAddress]) - free (delivery.street); - if (address.entry[entryCity]) - free (delivery.city); - if (address.entry[entryState]) - free (delivery.region); - if (address.entry[entryCountry]) - free (delivery.country); - if (address.entry[entryZip]) - free (delivery.code); + free (delivery.street); + free (delivery.city); + free (delivery.region); + free (delivery.country); + free (delivery.code); /* Phone numbers */ for (i = entryPhone1; i <= entryPhone5; i++) { char *phonelabel = ctxt->ai.phoneLabels[address.phoneLabel[i - entryPhone1]]; char *phonenum = get_entry_text (address, i); - + if (!strcmp (phonelabel, "E-mail")) e_card_simple_set(simple, E_CARD_SIMPLE_FIELD_EMAIL, phonenum); else if (!strcmp (phonelabel, "Home")) @@ -520,9 +515,10 @@ ecard_from_remote_record(EAddrConduitContext *ctxt, e_card_simple_set(simple, E_CARD_SIMPLE_FIELD_PHONE_PAGER, phonenum); else if (!strcmp (phonelabel, "Mobile")) e_card_simple_set(simple, E_CARD_SIMPLE_FIELD_PHONE_MOBILE, phonenum); + g_print (" ['%s' : '%s']\n", phonelabel, phonenum); - free (phonenum); + g_free (phonenum); } e_card_simple_sync_card (simple); @@ -605,6 +601,7 @@ card_removed (EBookView *book_view, const char *id, EAddrConduitContext *ctxt) static void sequence_complete (EBookView *book_view, EAddrConduitContext *ctxt) { + gtk_signal_disconnect_by_data (GTK_OBJECT (book_view), ctxt); gtk_object_unref (GTK_OBJECT (book_view)); gtk_main_quit (); } |