[geary/wip/721828-undo-2] Ensure ClientSessionManager.close_async doesn't hang



commit a724e432045a204251a735f85dfdd8f5d67a4772
Author: Jim Nelson <jim yorba org>
Date:   Tue Feb 3 17:37:00 2015 -0800

    Ensure ClientSessionManager.close_async doesn't hang
    
    This comes up because we're now closing Accounts when the application
    exits.

 .../transport/imap-client-session-manager.vala     |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/engine/imap/transport/imap-client-session-manager.vala 
b/src/engine/imap/transport/imap-client-session-manager.vala
index 2f9f1de..e11ac2e 100644
--- a/src/engine/imap/transport/imap-client-session-manager.vala
+++ b/src/engine/imap/transport/imap-client-session-manager.vala
@@ -137,10 +137,15 @@ public class Geary.Imap.ClientSessionManager : BaseObject {
         
         // TODO: This isn't the best (deterministic) way to deal with this, but it's easy and works
         // for now
+        int attempts = 0;
         while (sessions.size > 0) {
             debug("Waiting for ClientSessions to disconnect from ClientSessionManager...");
             Timeout.add(250, close_async.callback);
             yield;
+            
+            // give up after three seconds
+            if (++attempts > 12)
+                break;
         }
     }
     


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