[balsa/gtk3] Remember when we have opened Inbox twice



commit 4ebb51b3d1155c92946165b70c32cbca702192e9
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Mon Mar 4 08:09:18 2013 -0500

    Remember when we have opened Inbox twice
    
        * src/main.c (initial_open_inbox), (balsa_cleanup): remember
        when we have opened Inbox twice.
        * src/balsa-app.h: add member to remember it.

 ChangeLog       |    6 ++++++
 src/balsa-app.h |    1 +
 src/main.c      |    5 +++++
 3 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index b6b44a5..0c7e542 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2013-03-04  Peter Bloomfield
+
+       * src/main.c (initial_open_inbox), (balsa_cleanup): remember
+       when we have opened Inbox twice.
+       * src/balsa-app.h: add member to remember it.
+
 2013-03-03  Peter Bloomfield
 
        * src/balsa-index.c (balsa_index_scroll_on_open): always use an
diff --git a/src/balsa-app.h b/src/balsa-app.h
index 63252cc..3738d35 100644
--- a/src/balsa-app.h
+++ b/src/balsa-app.h
@@ -305,6 +305,7 @@ extern struct BalsaApplication {
 
     /* command line options */
     gint open_inbox_upon_startup;
+    gboolean inbox_has_extra_open_ref;
     gint check_mail_upon_startup;
     gint remember_open_mboxes;
     gint open_unread_mailbox;
diff --git a/src/main.c b/src/main.c
index 85d96e4..0cba86d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -336,6 +336,8 @@ initial_open_inbox()
     balsa_mblist_open_mailbox_hidden(balsa_app.inbox);
     gdk_threads_leave();
 
+    balsa_app.inbox_has_extra_open_ref = TRUE;
+
     return FALSE;
 }
 
@@ -718,6 +720,9 @@ balsa_cleanup(void)
     }
     pthread_mutex_unlock(&checking_mail_lock);
 #endif
+    if (balsa_app.inbox_has_extra_open_ref)
+        libbalsa_mailbox_close(balsa_app.inbox,
+                               balsa_app.expunge_on_close);
     balsa_app_destroy();
     g_hash_table_destroy(libbalsa_mailbox_view_table);
     libbalsa_mailbox_view_table = NULL;


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