diff options
author | Milan Crha <mcrha@redhat.com> | 2008-02-22 18:49:55 +0800 |
---|---|---|
committer | Milan Crha <mcrha@src.gnome.org> | 2008-02-22 18:49:55 +0800 |
commit | efb45db411d5f64e95cc2eba2501ff3f73239cb3 (patch) | |
tree | 1b296f58812fe164aa0a9bd600dbe46a3fe30121 /mail/mail-ops.c | |
parent | bdb224def86d58bde4218fa8ed21d689242923f9 (diff) | |
download | gsoc2013-evolution-efb45db411d5f64e95cc2eba2501ff3f73239cb3.tar.gz gsoc2013-evolution-efb45db411d5f64e95cc2eba2501ff3f73239cb3.tar.zst gsoc2013-evolution-efb45db411d5f64e95cc2eba2501ff3f73239cb3.zip |
** Fix for bug #512776
2008-02-22 Milan Crha <mcrha@redhat.com>
** Fix for bug #512776
* Changes below prevents deadlock on start or send/receive.
* mail-send-recv.c: (struct _refresh_folders_msg),
(refresh_folders_exec), (refresh_folders_free),
(receive_update_got_folderinfo): Do not look for active folders in
main thread, rather do it in other thread and free folder info later.
* mail-ops.h: (mail_get_folderinfo):
* mail-ops.c: (struct _get_folderinfo_msg), (get_folderinfo_done),
(get_folderinfo_free), (mail_get_folderinfo):
* mail-folder-cache.h: (mail_note_store):
* mail-folder-cache.c: (struct _update_data), (update_folders),
(mail_note_store):
* mail-component.c: (mc_add_store_done):
The 'done' function returns if we can free folder info or not.
svn path=/trunk/; revision=35071
Diffstat (limited to 'mail/mail-ops.c')
-rw-r--r-- | mail/mail-ops.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/mail/mail-ops.c b/mail/mail-ops.c index 894d4d8c2f..f11c2e0258 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -1042,8 +1042,9 @@ struct _get_folderinfo_msg { CamelStore *store; CamelFolderInfo *info; - void (*done)(CamelStore *store, CamelFolderInfo *info, void *data); + gboolean (*done)(CamelStore *store, CamelFolderInfo *info, void *data); void *data; + gboolean can_clear; /* whether we can clear folder info */ }; static gchar * @@ -1078,13 +1079,15 @@ get_folderinfo_done (struct _get_folderinfo_msg *m) } if (m->done) - m->done (m->store, m->info, m->data); + m->can_clear = m->done (m->store, m->info, m->data); + else + m->can_clear = TRUE; } static void get_folderinfo_free (struct _get_folderinfo_msg *m) { - if (m->info) + if (m->info && m->can_clear) camel_store_free_folder_info(m->store, m->info); camel_object_unref(m->store); } @@ -1098,7 +1101,7 @@ static MailMsgInfo get_folderinfo_info = { }; int -mail_get_folderinfo (CamelStore *store, CamelOperation *op, void (*done)(CamelStore *store, CamelFolderInfo *info, void *data), void *data) +mail_get_folderinfo (CamelStore *store, CamelOperation *op, gboolean (*done)(CamelStore *store, CamelFolderInfo *info, void *data), void *data) { struct _get_folderinfo_msg *m; int id; |