[geary] Workaround libsoup cache crashing when cancellable is actually cancelled.



commit 4ca86afc733b9050c0209c83da6a019fdb2658b5
Author: Michael James Gratton <mike vee net>
Date:   Thu Feb 16 10:20:38 2017 +1100

    Workaround libsoup cache crashing when cancellable is actually cancelled.
    
    Bug 778720.
    
    * src/client/conversation-viewer/conversation-message.vala
      (ConversationMessage::load_avatar): Don't pass thr load cancellable
      through to soup, just check to see if the load has been cancelled
      before attempting to set the icon.

 .../conversation-viewer/conversation-message.vala  |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/src/client/conversation-viewer/conversation-message.vala 
b/src/client/conversation-viewer/conversation-message.vala
index 8615e03..c8cd591 100644
--- a/src/client/conversation-viewer/conversation-message.vala
+++ b/src/client/conversation-viewer/conversation-message.vala
@@ -437,9 +437,18 @@ public class ConversationMessage : Gtk.Grid {
             );
 
             try {
-                InputStream data =
-                    yield session.send_async(message, load_cancelled);
-                if (data != null && message.status_code == 200) {
+                // We want to just pass load_cancelled to send_async
+                // here, but per Bug 778720 this is causing some
+                // crashy race in libsoup's cache implementation, so
+                // for now just let the load go through and manually
+                // check to see if the load has been cancelled before
+                // setting the avatar
+                InputStream data = yield session.send_async(
+                    message,
+                    null // should be 'load_cancelled'
+                );
+                if (!load_cancelled.is_cancelled() &&
+                    data != null && message.status_code == 200) {
                     yield set_avatar(data, load_cancelled);
                 }
             } catch (Error err) {


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