Fix up refcounting on current_folder.
authorDan Winship <danw@src.gnome.org>
Fri, 4 May 2001 15:26:13 +0000 (15:26 +0000)
committerDan Winship <danw@src.gnome.org>
Fri, 4 May 2001 15:26:13 +0000 (15:26 +0000)
* providers/imap/camel-imap-store.c (get_folder_online): Fix up
refcounting on current_folder.

* camel-disco-folder.c, camel-disco-store.h: Remove
CamelDiscoDiary refs that weren't supposed to escape yet.

camel/ChangeLog
camel/camel-disco-folder.c
camel/camel-disco-store.h
camel/providers/imap/camel-imap-store.c

index ecad1c1..8a5974f 100644 (file)
@@ -1,3 +1,11 @@
+2001-05-04  Dan Winship  <danw@ximian.com>
+
+       * providers/imap/camel-imap-store.c (get_folder_online): Fix up
+       refcounting on current_folder.
+
+       * camel-disco-folder.c, camel-disco-store.h: Remove
+       CamelDiscoDiary refs that weren't supposed to escape yet.
+
 2001-05-03  Dan Winship  <danw@ximian.com>
 
        * camel-disco-store.c: new abstract class for disconnectable
index bce6eae..91a12ad 100644 (file)
@@ -26,7 +26,6 @@
 #include <config.h>
 #endif
 
-#include "camel-disco-diary.h"
 #include "camel-disco-folder.h"
 #include "camel-disco-store.h"
 #include "camel-exception.h"
index 3bba4e8..abd2693 100644 (file)
@@ -51,7 +51,6 @@ struct _CamelDiscoStore {
        CamelRemoteStore parent_object; 
 
        CamelDiscoStoreStatus status;
-       CamelDiscoDiary *diary;
 };
 
 
index 0a5c442..74f420f 100644 (file)
@@ -803,7 +803,10 @@ get_folder_online (CamelStore *store, const char *folder_name,
 
        /* Lock around the whole lot to check/create atomically */
        CAMEL_IMAP_STORE_LOCK (imap_store, command_lock);
-       imap_store->current_folder = NULL;
+       if (imap_store->current_folder) {
+               camel_object_unref (CAMEL_OBJECT (imap_store->current_folder));
+               imap_store->current_folder = NULL;
+       }
        response = camel_imap_command (imap_store, NULL, NULL,
                                       "SELECT %S", folder_name);
        if (!response) {
@@ -833,7 +836,8 @@ get_folder_online (CamelStore *store, const char *folder_name,
                if (camel_exception_is_set (ex)) {
                        camel_object_unref (CAMEL_OBJECT (new_folder));
                        new_folder = imap_store->current_folder = NULL;
-               }
+               } else
+                       camel_object_ref (CAMEL_OBJECT (imap_store->current_folder));
        }
        camel_imap_response_free_without_processing (imap_store, response);