[balsa] Increase mailbox ref count while closing it



commit 5ad1a1dde46591a88c007735b54f1ad72c14ee1d
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Sat Mar 27 08:00:32 2010 -0400

    Increase mailbox ref count while closing it
    
    	* libbalsa/mailbox.c (libbalsa_mailbox_close): increase mailbox
    	ref count while closing it.

 ChangeLog          |    5 +++++
 libbalsa/mailbox.c |    2 ++
 2 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 2532828..8e28467 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-03-27  Peter Bloomfield
+
+	* libbalsa/mailbox.c (libbalsa_mailbox_close): increase mailbox
+	ref count while closing it.
+
 2010-03-23  Peter Bloomfield
 
 	* src/main.c: missing include.
diff --git a/libbalsa/mailbox.c b/libbalsa/mailbox.c
index f9faa17..cdb25bf 100644
--- a/libbalsa/mailbox.c
+++ b/libbalsa/mailbox.c
@@ -643,6 +643,7 @@ libbalsa_mailbox_close(LibBalsaMailbox * mailbox, gboolean expunge)
     g_return_if_fail(LIBBALSA_IS_MAILBOX(mailbox));
     g_return_if_fail(MAILBOX_OPEN(mailbox));
 
+    g_object_ref(mailbox);
     libbalsa_lock_mailbox(mailbox);
 
     if (--mailbox->open_ref == 0) {
@@ -662,6 +663,7 @@ libbalsa_mailbox_close(LibBalsaMailbox * mailbox, gboolean expunge)
     }
 
     libbalsa_unlock_mailbox(mailbox);
+    g_object_unref(mailbox);
 }
 
 void



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