aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-10-16 04:18:08 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-10-16 04:18:08 +0800
commitf620356a6fc4a13fa805370c5d768082ebfba856 (patch)
tree013f8da94bfa6d0ab30f4690e59780e7f132e780
parent244694ee58bf5eec443dc26135fc78fb24bcbd57 (diff)
downloadgsoc2013-evolution-f620356a6fc4a13fa805370c5d768082ebfba856.tar
gsoc2013-evolution-f620356a6fc4a13fa805370c5d768082ebfba856.tar.gz
gsoc2013-evolution-f620356a6fc4a13fa805370c5d768082ebfba856.tar.bz2
gsoc2013-evolution-f620356a6fc4a13fa805370c5d768082ebfba856.tar.lz
gsoc2013-evolution-f620356a6fc4a13fa805370c5d768082ebfba856.tar.xz
gsoc2013-evolution-f620356a6fc4a13fa805370c5d768082ebfba856.tar.zst
gsoc2013-evolution-f620356a6fc4a13fa805370c5d768082ebfba856.zip
Call mail_vfolder_shutdown.
2001-10-15 Jeffrey Stedfast <fejj@ximian.com> * component-factory.c (owner_unset_cb): Call mail_vfolder_shutdown. * mail-vfolder.c (mail_vfolder_shutdown): Unref all of our VFolders. * mail-folder-cache.c (real_note_folder): Remember to unref the folder before returning if we have already noted this folder. svn path=/trunk/; revision=13682
-rw-r--r--mail/ChangeLog11
-rw-r--r--mail/component-factory.c22
-rw-r--r--mail/mail-folder-cache.c4
-rw-r--r--mail/mail-vfolder.c25
-rw-r--r--mail/mail-vfolder.h2
5 files changed, 57 insertions, 7 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index a1df585b46..e18f445d4c 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,14 @@
+2001-10-15 Jeffrey Stedfast <fejj@ximian.com>
+
+ * component-factory.c (owner_unset_cb): Call
+ mail_vfolder_shutdown.
+
+ * mail-vfolder.c (mail_vfolder_shutdown): Unref all of our
+ VFolders.
+
+ * mail-folder-cache.c (real_note_folder): Remember to unref the
+ folder before returning if we have already noted this folder.
+
2001-10-15 <NotZed@Ximian.com>
* mail-session.c (get_password): Proxy get-password call to main
diff --git a/mail/component-factory.c b/mail/component-factory.c
index 5d47f42d31..52f249b840 100644
--- a/mail/component-factory.c
+++ b/mail/component-factory.c
@@ -627,8 +627,16 @@ unref_standard_folders (void)
for (i = 0; i < sizeof (standard_folders) / sizeof (standard_folders[0]); i++) {
if (standard_folders[i].folder) {
CamelFolder *folder = *standard_folders[i].folder;
-
+
*standard_folders[i].folder = NULL;
+
+ if (CAMEL_OBJECT (folder)->ref_count == 1)
+ printf ("About to finalise folder %s\n", folder->full_name);
+ else
+ printf ("Folder %s still has %d extra ref%s on it\n", folder->full_name,
+ CAMEL_OBJECT (folder)->ref_count - 1,
+ CAMEL_OBJECT (folder)->ref_count - 1 == 1 ? "" : "s");
+
camel_object_unref (CAMEL_OBJECT (folder));
}
}
@@ -782,15 +790,15 @@ static gboolean
idle_quit (gpointer user_data)
{
mail_msg_wait_all();
-
+
if (e_list_length (folder_browser_factory_get_control_list ()))
return TRUE;
-
+
g_hash_table_foreach (storages_hash, free_storage, NULL);
g_hash_table_destroy (storages_hash);
-
+
gtk_main_quit ();
-
+
return FALSE;
}
@@ -820,9 +828,11 @@ owner_unset_cb (EvolutionShellComponent *shell_component, gpointer user_data)
if (mail_config_get_empty_trash_on_exit ())
empty_trash (NULL, NULL, NULL);
-
+
mail_msg_wait_all();
+ mail_vfolder_shutdown ();
+
unref_standard_folders ();
mail_importer_uninit ();
diff --git a/mail/mail-folder-cache.c b/mail/mail-folder-cache.c
index 9cad33c02e..b1bf92bee0 100644
--- a/mail/mail-folder-cache.c
+++ b/mail/mail-folder-cache.c
@@ -236,8 +236,10 @@ real_note_folder(CamelFolder *folder, void *event_data, void *data)
}
/* dont do anything if we already have this */
- if (mfi->folder == folder)
+ if (mfi->folder == folder) {
+ camel_object_unref (CAMEL_OBJECT (folder));
return;
+ }
mfi->folder = folder;
update_1folder(mfi, NULL);
diff --git a/mail/mail-vfolder.c b/mail/mail-vfolder.c
index 82ce02ea94..771190e31e 100644
--- a/mail/mail-vfolder.c
+++ b/mail/mail-vfolder.c
@@ -844,3 +844,28 @@ mail_vfolder_get_vfolder_storage (void)
{
return mail_lookup_storage(vfolder_store);
}
+
+
+static void
+vfolder_foreach_cb (gpointer key, gpointer data, gpointer user_data)
+{
+ CamelFolder *folder = CAMEL_FOLDER (data);
+
+ if (folder)
+ camel_object_unref (CAMEL_OBJECT (folder));
+
+ g_free (key);
+}
+
+void
+mail_vfolder_shutdown (void)
+{
+ g_hash_table_foreach (vfolder_hash, vfolder_foreach_cb, NULL);
+ g_hash_table_destroy (vfolder_hash);
+
+ if (vfolder_store)
+ camel_object_unref (CAMEL_OBJECT (vfolder_store));
+
+ if (context)
+ gtk_object_unref (GTK_OBJECT (context));
+}
diff --git a/mail/mail-vfolder.h b/mail/mail-vfolder.h
index ec27d8b8fb..f72adc35b4 100644
--- a/mail/mail-vfolder.h
+++ b/mail/mail-vfolder.h
@@ -29,4 +29,6 @@ void mail_vfolder_remove_uri(CamelStore *store, const char *uri);
EvolutionStorage *mail_vfolder_get_vfolder_storage (void);
+void mail_vfolder_shutdown (void);
+
#endif