diff options
author | Dan Winship <danw@src.gnome.org> | 2001-01-05 02:28:09 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2001-01-05 02:28:09 +0800 |
commit | f325b6f0a78108bd4ad550830117ce48c6b4df31 (patch) | |
tree | 6295a056d228fd3e6a6d64d228a218a738446912 | |
parent | 495030c715bc440ab4a57f7e6f49d8b711953906 (diff) | |
download | gsoc2013-evolution-f325b6f0a78108bd4ad550830117ce48c6b4df31.tar gsoc2013-evolution-f325b6f0a78108bd4ad550830117ce48c6b4df31.tar.gz gsoc2013-evolution-f325b6f0a78108bd4ad550830117ce48c6b4df31.tar.bz2 gsoc2013-evolution-f325b6f0a78108bd4ad550830117ce48c6b4df31.tar.lz gsoc2013-evolution-f325b6f0a78108bd4ad550830117ce48c6b4df31.tar.xz gsoc2013-evolution-f325b6f0a78108bd4ad550830117ce48c6b4df31.tar.zst gsoc2013-evolution-f325b6f0a78108bd4ad550830117ce48c6b4df31.zip |
Fix leaks, set unread count on folder creation as well as on changes
svn path=/trunk/; revision=7250
-rw-r--r-- | mail/folder-browser.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/mail/folder-browser.c b/mail/folder-browser.c index e61d317704..16d5c964a0 100644 --- a/mail/folder-browser.c +++ b/mail/folder-browser.c @@ -124,6 +124,7 @@ update_unread_count_main(CamelObject *object, gpointer event_data, gpointer user evolution_storage_update_folder_by_uri (storage, fb->uri, name, fb->unread_count != 0); g_free (name); + gtk_object_unref (GTK_OBJECT (storage)); } static void @@ -144,6 +145,7 @@ static void got_folder(char *uri, CamelFolder *folder, void *data) { FolderBrowser *fb = data; + EvolutionStorage *storage; printf("got folder '%s' = %p\n", uri, folder); @@ -161,8 +163,10 @@ got_folder(char *uri, CamelFolder *folder, void *data) camel_object_ref((CamelObject *)folder); - if (mail_lookup_storage (folder->parent_store)) { - fb->unread_count = -1; + if ((storage = mail_lookup_storage (folder->parent_store))) { + gtk_object_unref (GTK_OBJECT (storage)); + fb->unread_count = camel_folder_get_unread_message_count (folder); + update_unread_count_main ((CamelObject *)folder, NULL, fb); camel_object_hook_event ((CamelObject *)folder, "message_changed", update_unread_count, fb); } |