aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/conduit
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2001-12-16 00:17:32 +0800
committerJP Rosevear <jpr@src.gnome.org>2001-12-16 00:17:32 +0800
commit81d26e01cb0f918068f21e1b4c9bab5015a8a417 (patch)
tree24943f1df4d141513a4e7daa2938546ac3e40f21 /addressbook/conduit
parent333753cb268f79e02a1127628674d9066a5dcf32 (diff)
downloadgsoc2013-evolution-81d26e01cb0f918068f21e1b4c9bab5015a8a417.tar
gsoc2013-evolution-81d26e01cb0f918068f21e1b4c9bab5015a8a417.tar.gz
gsoc2013-evolution-81d26e01cb0f918068f21e1b4c9bab5015a8a417.tar.bz2
gsoc2013-evolution-81d26e01cb0f918068f21e1b4c9bab5015a8a417.tar.lz
gsoc2013-evolution-81d26e01cb0f918068f21e1b4c9bab5015a8a417.tar.xz
gsoc2013-evolution-81d26e01cb0f918068f21e1b4c9bab5015a8a417.tar.zst
gsoc2013-evolution-81d26e01cb0f918068f21e1b4c9bab5015a8a417.zip
don't free the hash table keys, we didn't allocate them and free the
2001-12-15 JP Rosevear <jpr@ximian.com> * conduit/address-conduit.c (e_addr_context_destroy): don't free the hash table keys, we didn't allocate them and free the change objects and unref the associated cards (local_record_from_uid): unref the temp card we create (replace_record): ref the new card associated with the card change and unref the old one svn path=/trunk/; revision=15091
Diffstat (limited to 'addressbook/conduit')
-rw-r--r--addressbook/conduit/address-conduit.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/addressbook/conduit/address-conduit.c b/addressbook/conduit/address-conduit.c
index 0c0645c2e9..6791d0e445 100644
--- a/addressbook/conduit/address-conduit.c
+++ b/addressbook/conduit/address-conduit.c
@@ -200,14 +200,6 @@ e_addr_context_new (guint32 pilot_id)
return ctxt;
}
-static gboolean
-e_addr_context_foreach_change (gpointer key, gpointer value, gpointer data)
-{
- g_free (key);
-
- return TRUE;
-}
-
static void
e_addr_context_destroy (EAddrConduitContext *ctxt)
{
@@ -227,13 +219,20 @@ e_addr_context_destroy (EAddrConduitContext *ctxt)
g_list_free (ctxt->cards);
}
- if (ctxt->changed_hash != NULL) {
- g_hash_table_foreach_remove (ctxt->changed_hash, e_addr_context_foreach_change, NULL);
+ if (ctxt->changed_hash != NULL)
g_hash_table_destroy (ctxt->changed_hash);
- }
- if (ctxt->changed != NULL)
+ if (ctxt->changed != NULL) {
+ CardObjectChange *coc;
+
+ for (l = ctxt->changed; l != NULL; l = l->next) {
+ coc = l->data;
+
+ gtk_object_unref (GTK_OBJECT (coc->card));
+ g_free (coc);
+ }
g_list_free (ctxt->changed);
+ }
if (ctxt->locals != NULL) {
for (l = ctxt->locals; l != NULL; l = l->next)
@@ -827,6 +826,7 @@ local_record_from_uid (EAddrLocalRecord *local,
ecard = e_card_new ("");
e_card_set_id (ecard, uid);
local_record_from_ecard (local, ecard, ctxt);
+ gtk_object_unref (GTK_OBJECT (ecard));
}
}
@@ -1397,9 +1397,10 @@ replace_record (GnomePilotConduitSyncAbs *conduit,
coc = g_hash_table_lookup (ctxt->changed_hash, old_id);
if (coc) {
g_hash_table_remove (ctxt->changed_hash, e_card_get_id (coc->card));
+ gtk_object_unref (GTK_OBJECT (coc->card));
+ gtk_object_ref (GTK_OBJECT (local->ecard));
coc->card = local->ecard;
g_hash_table_insert (ctxt->changed_hash, (gpointer)e_card_get_id (coc->card), coc);
-
}
commit_status = cons.status;