2005-07-09 [hoa] 1.9.12cvs31
authorHoà Viêt Dinh <dinh.viet.hoa@free.fr>
Sat, 9 Jul 2005 11:46:52 +0000 (11:46 +0000)
committerHoà Viêt Dinh <dinh.viet.hoa@free.fr>
Sat, 9 Jul 2005 11:46:52 +0000 (11:46 +0000)
* src/imap.c
* src/etpan/imap-thread.c
fixed deadlock when removing IMAP account.

ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/etpan/imap-thread.c
src/imap.c

index 6c2419c..05fca53 100644 (file)
@@ -1,3 +1,9 @@
+2005-07-09 [hoa]       1.9.12cvs31
+
+       * src/imap.c
+       * src/etpan/imap-thread.c
+               fixed deadlock when removing IMAP account.
+
 2005-07-08 [colin]     1.9.12cvs30
 
        * src/textview.c
index b5b0693..35d538f 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.179.2.50 -r 1.179.2.51 src/imap.c;  ) > 1.9.12cvs28.patchset
 ( cvs diff -u -r 1.16.2.21 -r 1.16.2.22 src/msgcache.c;  ) > 1.9.12cvs29.patchset
 ( cvs diff -u -r 1.96.2.60 -r 1.96.2.61 src/textview.c;  cvs diff -u -r 1.8.2.5 -r 1.8.2.6 src/unmime.c;  cvs diff -u -r 1.2.2.9 -r 1.2.2.10 src/gtk/inputdialog.c;  ) > 1.9.12cvs30.patchset
+( cvs diff -u -r 1.179.2.51 -r 1.179.2.52 src/imap.c;  cvs diff -u -r 1.1.4.4 -r 1.1.4.5 src/etpan/imap-thread.c;  ) > 1.9.12cvs31.patchset
index d8ffbaa..1cbadc0 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=12
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=30
+EXTRA_VERSION=31
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index b7d0026..1054bf4 100644 (file)
@@ -67,11 +67,12 @@ void imap_main_set_timeout(int sec)
 
 void imap_main_done(void)
 {
+       etpan_thread_manager_stop(thread_manager);
+       etpan_thread_manager_join(thread_manager);
+       
        g_source_remove(thread_manager_signal);
        g_io_channel_unref(io_channel);
        
-       etpan_thread_manager_stop(thread_manager);
-       etpan_thread_manager_join(thread_manager);
        etpan_thread_manager_free(thread_manager);
        
        chash_free(session_hash);
@@ -110,9 +111,11 @@ void imap_done(Folder * folder)
        
        thread = value.data;
        
-       etpan_thread_stop(thread);
+       etpan_thread_unbind(thread);
        
        chash_delete(imap_hash, &key, NULL);
+       
+       debug_print("remove thread");
 }
 
 static struct etpan_thread * get_thread(Folder * folder)
@@ -155,6 +158,8 @@ static void generic_cb(int cancelled, void * result, void * callback_data)
        int * p_finished;
        
        p_finished = callback_data;
+
+       debug_print("generic_cb\n");
        
        * p_finished = 1;
 }
@@ -1378,6 +1383,8 @@ static void fetch_content_run(struct etpan_thread_op * op)
        
        param = op->param;
        
+       content = NULL;
+       content_size = 0;
        if (param->with_body)
                r = imap_fetch(param->imap, param->msg_index,
                               &content, &content_size);
index 2c09b01..bcdc42f 100644 (file)
@@ -464,13 +464,13 @@ static void imap_folder_destroy(Folder *folder)
 {
        gchar *dir;
 
-       imap_done(folder);
        dir = imap_folder_get_path(folder);
        if (is_dir_exist(dir))
                remove_dir_recursive(dir);
        g_free(dir);
 
        folder_remote_folder_destroy(REMOTE_FOLDER(folder));
+       imap_done(folder);
 }
 
 static void imap_folder_init(Folder *folder, const gchar *name,