From: Ricardo Mones Date: Fri, 12 Oct 2012 15:13:17 +0000 (+0000) Subject: 2012-10-12 [mones] 3.8.1cvs98 X-Git-Tag: REL_3_9_0~26 X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=d0d41b845f48c57f7c9fbe65e506e296b8678160 2012-10-12 [mones] 3.8.1cvs98 * src/compose.c * src/grouplistdialog.c * src/imap.c * src/news_gtk.c * src/procmime.c * src/procmsg.c * src/common/utils.c * src/common/utils.h * src/etpan/imap-thread.c New slist_free_strings_full wrapper for g_slist_free_full and simplify calls where it was being used --- diff --git a/ChangeLog b/ChangeLog index 9d626b629..d1704be5c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2012-10-12 [mones] 3.8.1cvs98 + + * src/compose.c + * src/grouplistdialog.c + * src/imap.c + * src/news_gtk.c + * src/procmime.c + * src/procmsg.c + * src/common/utils.c + * src/common/utils.h + * src/etpan/imap-thread.c + New slist_free_strings_full wrapper for g_slist_free_full + and simplify calls where it was being used + 2012-10-12 [colin] 3.8.1cvs97 * src/common/defs.h diff --git a/PATCHSETS b/PATCHSETS index 55095d82c..89f0b92b1 100644 --- a/PATCHSETS +++ b/PATCHSETS @@ -4472,3 +4472,4 @@ ( cvs diff -u -r 1.36.2.205 -r 1.36.2.206 src/common/utils.c; ) > 3.8.1cvs95.patchset ( cvs diff -u -r 1.1.2.31 -r 1.1.2.32 src/gtk/gtkcmctree.c; cvs diff -u -r 1.1.4.64 -r 1.1.4.65 src/gtk/gtksctree.c; ) > 3.8.1cvs96.patchset ( cvs diff -u -r 1.9.2.60 -r 1.9.2.61 src/common/defs.h; ) > 3.8.1cvs97.patchset +( cvs diff -u -r 1.382.2.616 -r 1.382.2.617 src/compose.c; cvs diff -u -r 1.14.2.34 -r 1.14.2.35 src/grouplistdialog.c; cvs diff -u -r 1.179.2.267 -r 1.179.2.268 src/imap.c; cvs diff -u -r 1.2.2.36 -r 1.2.2.37 src/news_gtk.c; cvs diff -u -r 1.49.2.153 -r 1.49.2.154 src/procmime.c; cvs diff -u -r 1.150.2.130 -r 1.150.2.131 src/procmsg.c; cvs diff -u -r 1.36.2.206 -r 1.36.2.207 src/common/utils.c; cvs diff -u -r 1.20.2.81 -r 1.20.2.82 src/common/utils.h; cvs diff -u -r 1.1.4.122 -r 1.1.4.123 src/etpan/imap-thread.c; ) > 3.8.1cvs98.patchset diff --git a/configure.ac b/configure.ac index a4147cec6..46ef478bb 100644 --- a/configure.ac +++ b/configure.ac @@ -12,7 +12,7 @@ MINOR_VERSION=8 MICRO_VERSION=1 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=97 +EXTRA_VERSION=98 EXTRA_RELEASE= EXTRA_GTK2_VERSION= diff --git a/src/common/utils.c b/src/common/utils.c index 1696267ee..1e39043b5 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -264,6 +264,19 @@ void slist_free_strings(GSList *list) } } +void slist_free_strings_full(GSList *list) +{ +#if GLIB_CHECK_VERSION(2,28,0) + g_slist_free_full(list, (GDestroyNotify)g_free); +#else + while (list != NULL) { + g_free(list->data); + list = list->next; + } + g_slist_free(list); +#endif +} + static void hash_free_strings_func(gpointer key, gpointer value, gpointer data) { g_free(key); diff --git a/src/common/utils.h b/src/common/utils.h index e120c8a10..df340e7ff 100644 --- a/src/common/utils.h +++ b/src/common/utils.h @@ -278,6 +278,7 @@ gboolean superuser_p (void); void list_free_strings (GList *list); void slist_free_strings (GSList *list); +void slist_free_strings_full (GSList *list); void hash_free_strings (GHashTable *table); diff --git a/src/compose.c b/src/compose.c index 186dd4ffe..4520069ac 100644 --- a/src/compose.c +++ b/src/compose.c @@ -2963,8 +2963,7 @@ static gchar *compose_parse_references(const gchar *ref, const gchar *msgid) ref_id_list = g_slist_remove (ref_id_list, ref_id_list->next->data); } else { - slist_free_strings(ref_id_list); - g_slist_free(ref_id_list); + slist_free_strings_full(ref_id_list); return NULL; } } else @@ -2978,8 +2977,7 @@ static gchar *compose_parse_references(const gchar *ref, const gchar *msgid) g_string_append_printf(new_ref, "<%s>", (gchar *)cur->data); } - slist_free_strings(ref_id_list); - g_slist_free(ref_id_list); + slist_free_strings_full(ref_id_list); new_ref_str = new_ref->str; g_string_free(new_ref, FALSE); @@ -3354,8 +3352,7 @@ static void compose_reply_set_entry(Compose *compose, MsgInfo *msginfo, g_free(addr); } - slist_free_strings(cc_list); - g_slist_free(cc_list); + slist_free_strings_full(cc_list); } g_free(ac_email); @@ -4843,12 +4840,10 @@ gboolean compose_check_for_valid_recipient(Compose *compose) { gchar **strptr; /* free to and newsgroup list */ - slist_free_strings(compose->to_list); - g_slist_free(compose->to_list); + slist_free_strings_full(compose->to_list); compose->to_list = NULL; - slist_free_strings(compose->newsgroup_list); - g_slist_free(compose->newsgroup_list); + slist_free_strings_full(compose->newsgroup_list); compose->newsgroup_list = NULL; /* search header entries for to and newsgroup entries */ @@ -8535,15 +8530,11 @@ static void compose_destroy(Compose *compose) * however this may change. */ address_completion_end(compose->window); - slist_free_strings(compose->to_list); - g_slist_free(compose->to_list); - slist_free_strings(compose->newsgroup_list); - g_slist_free(compose->newsgroup_list); - slist_free_strings(compose->header_list); - g_slist_free(compose->header_list); + slist_free_strings_full(compose->to_list); + slist_free_strings_full(compose->newsgroup_list); + slist_free_strings_full(compose->header_list); - slist_free_strings(extra_headers); - g_slist_free(extra_headers); + slist_free_strings_full(extra_headers); extra_headers = NULL; compose->header_list = compose->newsgroup_list = compose->to_list = NULL; diff --git a/src/etpan/imap-thread.c b/src/etpan/imap-thread.c index b0cd341ec..d4e3bf0b9 100644 --- a/src/etpan/imap-thread.c +++ b/src/etpan/imap-thread.c @@ -2136,8 +2136,7 @@ result_to_uid_flags_list(clist * fetch_result, carray ** result) free_list: imap_fetch_uid_flags_list_free(tab); - slist_free_strings(tags); - g_slist_free(tags); + slist_free_strings_full(tags); err: return res; } diff --git a/src/grouplistdialog.c b/src/grouplistdialog.c index 7282779d0..83b0ea76b 100644 --- a/src/grouplistdialog.c +++ b/src/grouplistdialog.c @@ -123,8 +123,7 @@ GSList *grouplist_dialog(Folder *folder) gtk_widget_hide(dialog); if (!ack) { - slist_free_strings(subscribed); - g_slist_free(subscribed); + slist_free_strings_full(subscribed); subscribed = NULL; for (node = folder->node->children; node != NULL; diff --git a/src/imap.c b/src/imap.c index bb15d8191..8c9df8509 100644 --- a/src/imap.c +++ b/src/imap.c @@ -1379,8 +1379,7 @@ static void imap_commit_tags(FolderItem *item, MsgInfo *msginfo, GSList *tags_se if (list_set) { ok = imap_set_message_flags(session, IMAP_FOLDER_ITEM(item), &numlist, 0, list_set, TRUE); - slist_free_strings(list_set); - g_slist_free(list_set); + slist_free_strings_full(list_set); if (ok != MAILIMAP_NO_ERROR) { return; } @@ -1395,8 +1394,7 @@ static void imap_commit_tags(FolderItem *item, MsgInfo *msginfo, GSList *tags_se if (list_unset) { ok = imap_set_message_flags(session, IMAP_FOLDER_ITEM(item), &numlist, 0, list_unset, FALSE); - slist_free_strings(list_unset); - g_slist_free(list_unset); + slist_free_strings_full(list_unset); if (ok != MAILIMAP_NO_ERROR) { return; } @@ -3312,8 +3310,7 @@ static void *imap_get_uncached_messages_thread(void *data) tags = carray_get(env_list, i+1); msginfo = imap_envelope_from_lep(info, item); if (msginfo == NULL) { - slist_free_strings(tags); - g_slist_free(tags); + slist_free_strings_full(tags); continue; } g_slist_free(msginfo->tags); @@ -3336,8 +3333,7 @@ static void *imap_get_uncached_messages_thread(void *data) } if (msginfo->tags) msginfo->tags = g_slist_reverse(msginfo->tags); - slist_free_strings(tags); - g_slist_free(tags); + slist_free_strings_full(tags); msginfo->folder = item; if (!newlist) llast = newlist = g_slist_append(newlist, msginfo); @@ -3821,8 +3817,7 @@ static gint imap_status(IMAPSession *session, IMAPFolder *folder, static void imap_free_capabilities(IMAPSession *session) { - slist_free_strings(session->capability); - g_slist_free(session->capability); + slist_free_strings_full(session->capability); session->capability = NULL; } @@ -5113,8 +5108,7 @@ bail: GINT_TO_POINTER(id)); g_free(real_tag); } - slist_free_strings(tags); - g_slist_free(tags); + slist_free_strings_full(tags); } } diff --git a/src/news_gtk.c b/src/news_gtk.c index 32c8f24e4..c848853ab 100644 --- a/src/news_gtk.c +++ b/src/news_gtk.c @@ -231,8 +231,7 @@ static void subscribe_newsgroup_cb(GtkAction *action, gpointer data) gtk_cmclist_thaw(GTK_CMCLIST(ctree)); - slist_free_strings(new_subscr); - g_slist_free(new_subscr); + slist_free_strings_full(new_subscr); folder_write_list(); } diff --git a/src/procmime.c b/src/procmime.c index 91b40e2e5..9b953bc2d 100644 --- a/src/procmime.c +++ b/src/procmime.c @@ -1822,8 +1822,7 @@ static void parse_parameters(const gchar *parameters, GHashTable *table) g_hash_table_insert(table, g_strdup(attribute), g_strdup(value->str)); g_string_free(value, TRUE); } - slist_free_strings(concatlist); - g_slist_free(concatlist); + slist_free_strings_full(concatlist); for (cur = convlist; cur != NULL; cur = g_slist_next(cur)) { gchar *attribute, *key, *value; @@ -1856,8 +1855,7 @@ static void parse_parameters(const gchar *parameters, GHashTable *table) g_hash_table_insert(table, g_strdup(attribute), newvalue); } - slist_free_strings(convlist); - g_slist_free(convlist); + slist_free_strings_full(convlist); g_free(params); } diff --git a/src/procmsg.c b/src/procmsg.c index 08888d09a..8a0e0e086 100644 --- a/src/procmsg.c +++ b/src/procmsg.c @@ -1431,8 +1431,7 @@ void procmsg_msginfo_free(MsgInfo *msginfo) g_free(msginfo->extradata->account_login); g_free(msginfo->extradata); } - slist_free_strings(msginfo->references); - g_slist_free(msginfo->references); + slist_free_strings_full(msginfo->references); g_slist_free(msginfo->tags); g_free(msginfo->plaintext_file); @@ -1642,10 +1641,8 @@ send_mail: procmime_mimeinfo_free_all(mimeinfo); g_free(from); g_free(smtpserver); - slist_free_strings(to_list); - g_slist_free(to_list); - slist_free_strings(newsgroup_list); - g_slist_free(newsgroup_list); + slist_free_strings_full(to_list); + slist_free_strings_full(newsgroup_list); g_free(savecopyfolder); g_free(replymessageid); g_free(fwdmessageid); @@ -1884,10 +1881,8 @@ send_mail: g_free(from); g_free(smtpserver); - slist_free_strings(to_list); - g_slist_free(to_list); - slist_free_strings(newsgroup_list); - g_slist_free(newsgroup_list); + slist_free_strings_full(to_list); + slist_free_strings_full(newsgroup_list); g_free(savecopyfolder); g_free(replymessageid); g_free(fwdmessageid);