From 5861eb8e7b1ae59b5e5cf600b36c6bf947b806bc Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Wed, 7 Apr 2004 15:09:49 +0000 Subject: Probably fixes bug #56623 and others? 2004-04-07 Jeffrey Stedfast Probably fixes bug #56623 and others? * e-signature-list.c (gconf_signatures_changed): Fixed to not use free'd iter memory. Also reverse the new_sigs list before adding them to the signature list (so they are in the same order they appeared in the gconf key). svn path=/trunk/; revision=25352 --- e-util/ChangeLog | 9 +++++++++ e-util/e-signature-list.c | 26 +++++++++++++++----------- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/e-util/ChangeLog b/e-util/ChangeLog index e8e0a8fcc4..1c430aa365 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -1,3 +1,12 @@ +2004-04-07 Jeffrey Stedfast + + Probably fixes bug #56623 and others? + + * e-signature-list.c (gconf_signatures_changed): Fixed to not use + free'd iter memory. Also reverse the new_sigs list before adding + them to the signature list (so they are in the same order they + appeared in the gconf key). + 2004-04-05 Jeffrey Stedfast * e-signature-list.c (gconf_signatures_changed): Fixed to not diff --git a/e-util/e-signature-list.c b/e-util/e-signature-list.c index ea3d6e7bb7..b14535b2fc 100644 --- a/e-util/e-signature-list.c +++ b/e-util/e-signature-list.c @@ -177,9 +177,8 @@ gconf_signatures_changed (GConfClient *client, guint cnxn_id, GConfEntry *entry, g_signal_emit (signature_list, signals[SIGNATURE_CHANGED], 0, signature); g_object_unref (iter); - g_free (uid); - continue; + goto loop; } } @@ -190,18 +189,23 @@ gconf_signatures_changed (GConfClient *client, guint cnxn_id, GConfEntry *entry, signature = e_signature_new_from_xml (l->data); e_list_append (E_LIST (signature_list), signature); new_sigs = g_slist_prepend (new_sigs, signature); + + loop: + g_free (uid); } - /* Now emit signals for each added signature. */ - l = new_sigs; - while (l != NULL) { - n = l->next; - signature = l->data; - g_signal_emit (signature_list, signals[SIGNATURE_ADDED], 0, signature); - g_object_unref (signature); - g_slist_free_1 (l); - l = n; + if (new_sigs != NULL) { + /* Now emit signals for each added signature. */ + l = g_slist_reverse (new_sigs); + while (l != NULL) { + n = l->next; + signature = l->data; + g_signal_emit (signature_list, signals[SIGNATURE_ADDED], 0, signature); + g_object_unref (signature); + g_slist_free_1 (l); + l = n; + } } /* Anything left in old_sigs must have been deleted */ -- cgit v1.2.3