[balsa] imap_search: Keep handle alive while searching



commit b36178ac43f4d9366c466029db6aa53e18604c0a
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Tue Jun 26 11:17:13 2018 -0400

    imap_search: Keep handle alive while searching
    
    * libbalsa/imap/imap_search.c (imap_search_exec): keep the
      ImapMboxHandle alive while searching.

 ChangeLog                   | 5 +++++
 libbalsa/imap/imap_search.c | 2 ++
 2 files changed, 7 insertions(+)
---
diff --git a/ChangeLog b/ChangeLog
index 0e680a4c2..7693d9c18 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2018-06-26  Peter Bloomfield  <pbloomfield bellsouth net>
+
+       * libbalsa/imap/imap_search.c (imap_search_exec): keep the
+       handle alive while searching.
+
 2018-06-24  Peter Bloomfield  <pbloomfield bellsouth net>
 
        Make the 'Balsa closes…' notification outlive the main window,
diff --git a/libbalsa/imap/imap_search.c b/libbalsa/imap/imap_search.c
index 025c18220..7fee22d83 100644
--- a/libbalsa/imap/imap_search.c
+++ b/libbalsa/imap/imap_search.c
@@ -541,9 +541,11 @@ imap_search_exec(ImapMboxHandle *h, gboolean uid,
 {
   ImapResponse rc;
 
+  g_object_ref(h);
   g_mutex_lock(&h->mutex);
   rc = imap_search_exec_unlocked(h, uid, s, cb, cb_arg);
   g_mutex_unlock(&h->mutex);
+  g_object_unref(h);
 
   return rc;
 }


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