[geary] Crash on exit: Bug #744522



commit 37093cca9f649b8ee76eaaefd5394758e6757a9b
Author: Jim Nelson <jim yorba org>
Date:   Tue Feb 17 12:10:43 2015 -0800

    Crash on exit: Bug #744522
    
    Assumed that getting a TreeModel iterator would always work isn't true
    at shudown when the model is being depopulated.  This removes
    assertion and only proceeds when valid every time.

 .../conversation-list/conversation-list-store.vala |   20 ++++++++------------
 1 files changed, 8 insertions(+), 12 deletions(-)
---
diff --git a/src/client/conversation-list/conversation-list-store.vala 
b/src/client/conversation-list/conversation-list-store.vala
index 25a05f7..7d83136 100644
--- a/src/client/conversation-list/conversation-list-store.vala
+++ b/src/client/conversation-list/conversation-list-store.vala
@@ -63,12 +63,8 @@ public class ConversationListStore : Gtk.ListStore {
             return row.get_path();
         }
         
-        public Gtk.TreeIter get_iter() {
-            Gtk.TreeIter iter;
-            bool valid = row.get_model().get_iter(out iter, get_path());
-            assert(valid);
-            
-            return iter;
+        public bool get_iter(out Gtk.TreeIter iter) {
+            return row.get_model().get_iter(out iter, get_path());
         }
     }
     
@@ -356,15 +352,15 @@ public class ConversationListStore : Gtk.ListStore {
     }
     
     private bool get_iter_for_conversation(Geary.App.Conversation conversation, out Gtk.TreeIter iter) {
-        // use get_iter_first() because boxing Gtk.TreeIter with a nullable is problematic with
-        // current bindings
         RowWrapper? wrapper = row_map.get(conversation);
         if (wrapper != null)
-            iter = wrapper.get_iter();
-        else
-            get_iter_first(out iter);
+            return wrapper.get_iter(out iter);
         
-        return wrapper != null;
+        // use get_iter_first() because boxing Gtk.TreeIter with a nullable is problematic with
+        // current bindings
+        get_iter_first(out iter);
+        
+        return false;
     }
     
     private bool has_conversation(Geary.App.Conversation conversation) {


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