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
This commit is contained in:
Jeffrey Stedfast
2001-10-15 20:18:08 +00:00
committed by Jeffrey Stedfast
parent 244694ee58
commit f620356a6f
5 changed files with 57 additions and 7 deletions

View File

@ -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

View File

@ -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 ();

View File

@ -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);

View File

@ -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));
}

View File

@ -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