2005-08-02 [colin] 1.9.13cvs5
authorColin Leroy <colin@colino.net>
Tue, 2 Aug 2005 07:26:13 +0000 (07:26 +0000)
committerColin Leroy <colin@colino.net>
Tue, 2 Aug 2005 07:26:13 +0000 (07:26 +0000)
* src/folder.c
* src/folderview.c
* src/imap.c
* src/main.c
* src/mbox.c
* src/procmsg.c
* src/summaryview.c
Fix a number of folder_item_get_msg_list()-related
leaks (missing procmsg_msginfo_free()s)

ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/folder.c
src/folderview.c
src/imap.c
src/main.c
src/mbox.c
src/procmsg.c
src/summaryview.c

index b1d1876af4f222239d4c44128dd31765974926ff..d9a1b6ef8534cb39bb4380ff1ac952115dde6077 100644 (file)
@@ -1,3 +1,15 @@
+2005-08-02 [colin]     1.9.13cvs5
+
+       * src/folder.c
+       * src/folderview.c
+       * src/imap.c
+       * src/main.c
+       * src/mbox.c
+       * src/procmsg.c
+       * src/summaryview.c
+               Fix a number of folder_item_get_msg_list()-related
+               leaks (missing procmsg_msginfo_free()s)
+
 2005-08-01 [colin]     1.9.13cvs4
 
        * src/folderview.c
index 165067996f6cbb529406ea4ae9ec30a3b4d53249..464fbf712ae837a9267ce84323d8e09cf461d992 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.395.2.97 -r 1.395.2.98 src/summaryview.c;  ) > 1.9.13cvs2.patchset
 ( cvs diff -u -r 1.115.2.45 -r 1.115.2.46 src/main.c;  cvs diff -u -r 1.1.4.2 -r 1.1.4.3 src/etpan/etpan-thread-manager-types.h;  ) > 1.9.13cvs3.patchset
 ( cvs diff -u -r 1.207.2.47 -r 1.207.2.48 src/folderview.c;  cvs diff -u -r 1.20.2.4 -r 1.20.2.5 src/folderview.h;  cvs diff -u -r 1.274.2.46 -r 1.274.2.47 src/mainwindow.c;  cvs diff -u -r 1.4.2.10 -r 1.4.2.11 src/prefs_fonts.c;  cvs diff -u -r 1.1.2.5 -r 1.1.2.6 src/prefs_summaries.c;  cvs diff -u -r 1.3.2.21 -r 1.3.2.22 src/prefs_themes.c;  cvs diff -u -r 1.395.2.98 -r 1.395.2.99 src/summaryview.c;  cvs diff -u -r 1.68.2.9 -r 1.68.2.10 src/summaryview.h;  cvs diff -u -r 1.96.2.65 -r 1.96.2.66 src/textview.c;  cvs diff -u -r 1.12.2.6 -r 1.12.2.7 src/textview.h;  ) > 1.9.13cvs4.patchset
+( cvs diff -u -r 1.213.2.43 -r 1.213.2.44 src/folder.c;  cvs diff -u -r 1.207.2.48 -r 1.207.2.49 src/folderview.c;  cvs diff -u -r 1.179.2.55 -r 1.179.2.56 src/imap.c;  cvs diff -u -r 1.115.2.46 -r 1.115.2.47 src/main.c;  cvs diff -u -r 1.28.2.5 -r 1.28.2.6 src/mbox.c;  cvs diff -u -r 1.150.2.31 -r 1.150.2.32 src/procmsg.c;  cvs diff -u -r 1.395.2.99 -r 1.395.2.100 src/summaryview.c;  ) > 1.9.13cvs5.patchset
index a1f0164e2e8f653ddf9a90a61411a62f31314e25..551907a61f9bd4a317b4b5d74769cf78620a0475 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=13
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=4
+EXTRA_VERSION=5
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index bbb0e69f739343f6213f44cea16a0ea6ab5adacb..11aee9686632f1916a557b8b7fce752b2cf527d0 100644 (file)
@@ -1964,6 +1964,20 @@ void folder_item_free_cache(FolderItem *item)
        item->cache = NULL;
 }
 
+void folder_clean_cache_memory_force(void)
+{
+       int old_cache_max_mem_usage = prefs_common.cache_max_mem_usage;
+       int old_cache_min_keep_time = prefs_common.cache_min_keep_time;
+
+       prefs_common.cache_max_mem_usage = 0;
+       prefs_common.cache_min_keep_time = 0;
+
+       folder_clean_cache_memory();
+
+       prefs_common.cache_max_mem_usage = old_cache_max_mem_usage;
+       prefs_common.cache_min_keep_time = old_cache_min_keep_time;
+}
+
 void folder_clean_cache_memory(void)
 {
        gint memusage = 0;
@@ -2523,8 +2537,6 @@ FolderItem *folder_item_move_recursive(FolderItem *src, FolderItem *dest)
        GNode *srcnode;
        gchar *old_id, *new_id;
 
-       mlist = folder_item_get_msg_list(src);
-       
        /* move messages */
        debug_print("Moving %s to %s\n", src->path, dest->path);
        new_item = folder_create_folder(dest, src->name);
@@ -2539,8 +2551,13 @@ FolderItem *folder_item_move_recursive(FolderItem *src, FolderItem *dest)
        /* move messages */
        log_message(_("Moving %s to %s...\n"), 
                        src->name, new_item->path);
-       if (mlist != NULL)
+
+       mlist = folder_item_get_msg_list(src);
+       
+       if (mlist != NULL) {
                folder_item_move_msgs(new_item, mlist);
+               procmsg_msg_list_free(mlist);
+       }
        
        /*copy prefs*/
        folder_item_prefs_copy_prefs(src, new_item);
@@ -2562,8 +2579,9 @@ FolderItem *folder_item_move_recursive(FolderItem *src, FolderItem *dest)
                if (srcnode && srcnode->data) {
                        next_item = (FolderItem*) srcnode->data;
                        srcnode = srcnode->next;
-                       if (folder_item_move_recursive(next_item, new_item) == NULL)
+                       if (folder_item_move_recursive(next_item, new_item) == NULL) {
                                return NULL;
+                       }
                }
        }
        old_id = folder_item_get_identifier(src);
@@ -2579,7 +2597,7 @@ FolderItem *folder_item_move_recursive(FolderItem *src, FolderItem *dest)
                prefs_filtering_rename_path(old_id, new_id);
        g_free(old_id);
        g_free(new_id);
-
+       
        return new_item;
 }
 
index 2af41e3f1674d11f5dd84428507b29a37e123373..493749232ddd8d7650f394e2be1aafa723115b18 100644 (file)
@@ -1584,8 +1584,11 @@ static gboolean folderview_button_pressed(GtkWidget *ctree, GdkEventButton *even
                 folderview->selected == folderview->opened);
        SET_SENS("/Properties...", item->node->parent != NULL);
        SET_SENS("/Processing...", item->node->parent != NULL);
-       if (item == folder->trash)
-               SET_SENS("/Empty trash...", folder_item_get_msg_list(item) != NULL);
+       if (item == folder->trash) {
+               GSList *msglist = folder_item_get_msg_list(item);
+               SET_SENS("/Empty trash...", msglist != NULL);
+               procmsg_msg_list_free(msglist);
+       }
 #undef SET_SENS
 
        popup = gtk_item_factory_get_widget(fpopup_factory, fpopup->path);
index d65101c0fbad558099b3f311399dde3e3e26196e..6c1a54fa623677e5e7c613ee781f7acdbf1e4b98 100644 (file)
@@ -1148,7 +1148,7 @@ static gint imap_remove_all_msg(Folder *folder, FolderItem *item)
 {
        GSList *list = folder_item_get_msg_list(item);
        gint res = imap_remove_msgs(folder, item, list, NULL);
-       g_slist_free(list);
+       procmsg_msg_list_free(list);
        return res;
 }
 
index cc6f78e7503f0d90f072bf79c037a6ae6f4a94d2..14c1bb1b4de29c8b6988ddae38a910c51d0fde4a 100644 (file)
@@ -402,6 +402,7 @@ int main(int argc, char *argv[])
        if (!cmd.crash && is_file_exist(get_crashfile_name())) {
                debug_print("Sylpheed crashed, checking for new messages in local folders\n");
                folderview_check_new(NULL);
+               folder_clean_cache_memory_force();
        }
        /* make the crash-indicator file */
        str_write_to_file("foo", get_crashfile_name());
index d16115ad26df934424ae2ae0fab43c6f4c9368f3..1c9ef548b8562d87fed0e0cd150834338d85e227 100644 (file)
@@ -429,7 +429,7 @@ gint export_to_mbox(FolderItem *src, const gchar *mbox)
 
        export_list_to_mbox(mlist, mbox);
 
-       g_slist_free(mlist);
+       procmsg_msg_list_free(mlist);
 
        return 0;
 }
index e60ba45eefdfc317ba611c57229b725da0e3fbb3..48ca1934e0fcece6a647288236298b62deebdd5f 100644 (file)
@@ -659,7 +659,7 @@ void procmsg_empty_trash(FolderItem *trash)
 
                        procmsg_msginfo_free(msginfo);
                }
-
+               g_slist_free(mlist);
                folder_item_remove_all_msg(trash);
        }
 }
@@ -878,14 +878,16 @@ gint procmsg_send_queue(FolderItem *queue, gboolean save_msgs)
 gboolean procmsg_queue_is_empty(FolderItem *queue)
 {
        GSList *list;
-
+       gboolean res = FALSE;
        if (!queue)
                queue = folder_get_default_queue();
        g_return_val_if_fail(queue != NULL, TRUE);
 
        folder_item_scan(queue);
        list = folder_item_get_msg_list(queue);
-       return (list == NULL);
+       res = (list == NULL);
+       procmsg_msg_list_free(list);
+       return res;
 }
 
 gint procmsg_remove_special_headers(const gchar *in, const gchar *out)
index a0d83f5e1db4db94809bb239da215487c4988f7a..fcef86b082048effa0ea6da8e9d20ab481dd2142 100644 (file)
@@ -5230,10 +5230,6 @@ static gboolean processing_apply_func(GNode *node, gpointer data)
                STATUSBAR_PUSH(summaryview->mainwin, buf);
                g_free(buf);
 
-/*
-               mlist = item->folder->get_msg_list(item->folder, item,
-                                                  TRUE);
-*/             
                mlist = folder_item_get_msg_list(item);
                for(cur = mlist ; cur != NULL && cur->data != NULL ; cur = cur->next) {
                        MsgInfo * msginfo;