balsa r8092 - in trunk: . libbalsa



Author: PeterB
Date: Sun Mar  1 15:06:57 2009
New Revision: 8092
URL: http://svn.gnome.org/viewvc/balsa?rev=8092&view=rev

Log:
do not leak ImapCacheManager

Modified:
   trunk/ChangeLog
   trunk/libbalsa/mailbox_imap.c

Modified: trunk/libbalsa/mailbox_imap.c
==============================================================================
--- trunk/libbalsa/mailbox_imap.c	(original)
+++ trunk/libbalsa/mailbox_imap.c	Sun Mar  1 15:06:57 2009
@@ -987,6 +987,7 @@
     unsigned i;
     guint total_messages;
     struct ImapCacheManager *icm;
+    gboolean from_file = FALSE;
 
     g_return_val_if_fail(LIBBALSA_IS_MAILBOX_IMAP(mailbox), FALSE);
 
@@ -1017,10 +1018,14 @@
 	gchar *header_cache_path = get_header_cache_path(mimap);
 	icm = imap_cache_manager_new_from_file(header_cache_path);
 	g_free(header_cache_path);
+        from_file = TRUE;
     }
     if (icm) {
         icm_restore_from_cache(mimap->handle, icm);
-        g_object_set_data(G_OBJECT(mailbox), "cache-manager", NULL);
+        if (from_file)
+            imap_cache_manager_free(icm);
+        else
+            g_object_set_data(G_OBJECT(mailbox), "cache-manager", NULL);
     }
 
     mailbox->first_unread = imap_mbox_handle_first_unseen(mimap->handle);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]