[evolution-data-server] Bug #617881 - Crash on fetch finish with POP3
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Bug #617881 - Crash on fetch finish with POP3
- Date: Thu, 6 May 2010 15:46:03 +0000 (UTC)
commit 4f303eac6c3a5c5eeca56db3787678b806a922c3
Author: Milan Crha <mcrha redhat com>
Date: Thu May 6 17:45:37 2010 +0200
Bug #617881 - Crash on fetch finish with POP3
camel/providers/pop3/camel-pop3-folder.c | 36 +++++++++++++++--------------
1 files changed, 19 insertions(+), 17 deletions(-)
---
diff --git a/camel/providers/pop3/camel-pop3-folder.c b/camel/providers/pop3/camel-pop3-folder.c
index a1d7d9c..ee33e01 100644
--- a/camel/providers/pop3/camel-pop3-folder.c
+++ b/camel/providers/pop3/camel-pop3-folder.c
@@ -49,7 +49,7 @@ static gchar * pop3_get_filename (CamelFolder *folder, const gchar *uid, CamelEx
G_DEFINE_TYPE (CamelPOP3Folder, camel_pop3_folder, CAMEL_TYPE_FOLDER)
static void
-pop3_folder_finalize (GObject *object)
+pop3_folder_dispose (GObject *object)
{
CamelPOP3Folder *pop3_folder = CAMEL_POP3_FOLDER (object);
CamelPOP3FolderInfo **fi = (CamelPOP3FolderInfo **)pop3_folder->uids->pdata;
@@ -58,26 +58,28 @@ pop3_folder_finalize (GObject *object)
gint i;
parent_store = camel_folder_get_parent_store (CAMEL_FOLDER (object));
- pop3_store = CAMEL_POP3_STORE (parent_store);
+ if (parent_store) {
+ pop3_store = CAMEL_POP3_STORE (parent_store);
+
+ if (pop3_folder->uids) {
+ for (i = 0; i < pop3_folder->uids->len; i++, fi++) {
+ if (fi[0]->cmd) {
+ while (camel_pop3_engine_iterate (pop3_store->engine, fi[0]->cmd) > 0)
+ ;
+ camel_pop3_engine_command_free (pop3_store->engine, fi[0]->cmd);
+ }
- if (pop3_folder->uids) {
- for (i=0;i<pop3_folder->uids->len;i++,fi++) {
- if (fi[0]->cmd) {
- while (camel_pop3_engine_iterate(pop3_store->engine, fi[0]->cmd) > 0)
- ;
- camel_pop3_engine_command_free(pop3_store->engine, fi[0]->cmd);
+ g_free (fi[0]->uid);
+ g_free (fi[0]);
}
- g_free(fi[0]->uid);
- g_free(fi[0]);
+ g_ptr_array_free (pop3_folder->uids, TRUE);
+ g_hash_table_destroy (pop3_folder->uids_uid);
}
-
- g_ptr_array_free(pop3_folder->uids, TRUE);
- g_hash_table_destroy(pop3_folder->uids_uid);
}
- /* Chain up to parent's finalize() method. */
- G_OBJECT_CLASS (camel_pop3_folder_parent_class)->finalize (object);
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (camel_pop3_folder_parent_class)->dispose (object);
}
static void
@@ -87,7 +89,7 @@ camel_pop3_folder_class_init (CamelPOP3FolderClass *class)
CamelFolderClass *folder_class;
object_class = G_OBJECT_CLASS (class);
- object_class->finalize = pop3_folder_finalize;
+ object_class->dispose = pop3_folder_dispose;
folder_class = CAMEL_FOLDER_CLASS (class);
folder_class->refresh_info = pop3_refresh_info;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]