aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog6
-rw-r--r--camel/providers/imap/camel-imap-command.c6
-rw-r--r--camel/providers/imap/camel-imap-store.c7
3 files changed, 17 insertions, 2 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 2a7c8b4347..d12d7f9971 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,5 +1,11 @@
2001-03-26 Dan Winship <danw@ximian.com>
+ * providers/imap/camel-imap-command.c (camel_imap_command): keep a
+ reference on the store's current_folder.
+
+ * providers/imap/camel-imap-store.c (camel_imap_store_finalize):
+ (imap_disconnect): unref the current_folder before clearing it.
+
* camel-url.c (camel_url_get_param): Add missing accessor.
* camel-session.c (camel_session_get_provider): New. Return
diff --git a/camel/providers/imap/camel-imap-command.c b/camel/providers/imap/camel-imap-command.c
index ac929b044a..b68216782c 100644
--- a/camel/providers/imap/camel-imap-command.c
+++ b/camel/providers/imap/camel-imap-command.c
@@ -87,12 +87,16 @@ camel_imap_command (CamelImapStore *store, CamelFolder *folder,
if (folder && (!fmt || folder != store->current_folder)) {
CamelImapResponse *response;
- store->current_folder = NULL;
+ if (store->current_folder) {
+ camel_object_unref (CAMEL_OBJECT (store->current_folder));
+ store->current_folder = NULL;
+ }
response = camel_imap_command (store, NULL, ex, "SELECT %S",
folder->full_name);
if (!response)
return NULL;
store->current_folder = folder;
+ camel_object_ref (CAMEL_OBJECT (folder));
camel_imap_folder_selected (folder, response, ex);
if (!fmt)
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
index fa7fac480a..de68eebbca 100644
--- a/camel/providers/imap/camel-imap-store.c
+++ b/camel/providers/imap/camel-imap-store.c
@@ -143,6 +143,8 @@ camel_imap_store_finalize (CamelObject *object)
}
if (imap_store->namespace)
g_free (imap_store->namespace);
+ if (imap_store->current_folder)
+ camel_object_unref (CAMEL_OBJECT (imap_store->current_folder));
#ifdef ENABLE_THREADS
e_mutex_destroy(imap_store->priv->command_lock);
#endif
@@ -724,7 +726,10 @@ imap_disconnect (CamelService *service, gboolean clean, CamelException *ex)
camel_imap_response_free (response);
}
store->connected = FALSE;
- store->current_folder = NULL;
+ if (store->current_folder) {
+ camel_object_unref (CAMEL_OBJECT (store->current_folder));
+ store->current_folder = NULL;
+ }
if (store->subscribed_folders) {
g_hash_table_foreach_remove (store->subscribed_folders,