[geary/wip/765516-gtk-widget-conversation-viewer: 133/142] Fix ConversationListStore instances never being finalised.



commit 51d4ccb80a161d72ffc3cebcd9f6afdcfc7713c5
Author: Michael James Gratton <mike vee net>
Date:   Fri Aug 19 13:30:44 2016 +1000

    Fix ConversationListStore instances never being finalised.
    
    * src/client/conversation-list/conversation-list-store.vala (ListStore):
      Make ::on_sort static to avoid a circular ref. Remove some signal handler
      disconnects that weren't a problem.

 .../conversation-viewer/conversation-listbox.vala  |   25 +++++++------------
 1 files changed, 9 insertions(+), 16 deletions(-)
---
diff --git a/src/client/conversation-viewer/conversation-listbox.vala 
b/src/client/conversation-viewer/conversation-listbox.vala
index 58bac60..05eae5f 100644
--- a/src/client/conversation-viewer/conversation-listbox.vala
+++ b/src/client/conversation-viewer/conversation-listbox.vala
@@ -110,6 +110,14 @@ public class ConversationListBox : Gtk.ListBox {
 
     }
 
+
+    private static int on_sort(Gtk.ListBoxRow row1, Gtk.ListBoxRow row2) {
+        ConversationEmail? msg1 = row1.get_child() as ConversationEmail;
+        ConversationEmail? msg2 = row2.get_child() as ConversationEmail;
+        return Geary.Email.compare_sent_date_ascending(msg1.email, msg2.email);
+    }
+
+
     /**
      * Returns the view for the email to be replied to, if any.
      *
@@ -186,13 +194,13 @@ public class ConversationListBox : Gtk.ListBox {
 
         set_adjustment(adjustment);
         set_selection_mode(Gtk.SelectionMode.NONE);
+        set_sort_func(ConversationListBox.on_sort);
 
         this.key_press_event.connect(on_key_press);
         this.realize.connect(() => {
                 adjustment.value_changed.connect(check_mark_read);
             });
         this.row_activated.connect(on_row_activated);
-        this.set_sort_func(on_sort);
         this.size_allocate.connect(() => { check_mark_read(); });
 
         this.conversation.appended.connect(on_conversation_appended);
@@ -202,15 +210,6 @@ public class ConversationListBox : Gtk.ListBox {
 
     public override void destroy() {
         this.cancellable.cancel();
-        this.conversation.email_flags_changed.disconnect(on_update_flags);
-        this.conversation.trimmed.disconnect(on_conversation_trimmed);
-        this.conversation.appended.disconnect(on_conversation_appended);
-        Gtk.Adjustment adjustment = get_adjustment();
-        if (adjustment != null) {
-            adjustment.value_changed.disconnect(check_mark_read);
-        }
-        this.body_selected_view = null;
-        this.last_email_row = null;
         this.id_to_row.clear();
         base.destroy();
     }
@@ -754,10 +753,4 @@ public class ConversationListBox : Gtk.ListBox {
         }
     }
 
-    private int on_sort(Gtk.ListBoxRow row1, Gtk.ListBoxRow row2) {
-        ConversationEmail? msg1 = row1.get_child() as ConversationEmail;
-        ConversationEmail? msg2 = row2.get_child() as ConversationEmail;
-        return Geary.Email.compare_sent_date_ascending(msg1.email, msg2.email);
-    }
-
 }


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