2012-10-12 [mones] 3.8.1cvs98
authorRicardo Mones <mones@claws-mail.org>
Fri, 12 Oct 2012 15:13:17 +0000 (15:13 +0000)
committerRicardo Mones <mones@claws-mail.org>
Fri, 12 Oct 2012 15:13:17 +0000 (15:13 +0000)
* 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

12 files changed:
ChangeLog
PATCHSETS
configure.ac
src/common/utils.c
src/common/utils.h
src/compose.c
src/etpan/imap-thread.c
src/grouplistdialog.c
src/imap.c
src/news_gtk.c
src/procmime.c
src/procmsg.c

index 9d626b6..d1704be 100644 (file)
--- 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
index 55095d8..89f0b92 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( 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
index a4147ce..46ef478 100644 (file)
@@ -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=
 
index 1696267..1e39043 100644 (file)
@@ -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);
index e120c8a..df340e7 100644 (file)
@@ -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);
 
index 186dd4f..4520069 100644 (file)
@@ -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;
index b0cd341..d4e3bf0 100644 (file)
@@ -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;
 }
index 7282779..83b0ea7 100644 (file)
@@ -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;
index bb15d81..8c9df85 100644 (file)
@@ -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);
                        }
                }
 
index 32c8f24..c848853 100644 (file)
@@ -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();
 }
index 91b40e2..9b953bc 100644 (file)
@@ -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);
 }      
index 08888d0..8a0e0e0 100644 (file)
@@ -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);