[nautilus] list-view: don't crash on view leaks



commit 6015ea403f1e4412f779bec1775a2ccbe3fe5d2a
Author: Carlos Soriano <csoriano gnome org>
Date:   Wed Oct 5 19:40:50 2016 +0200

    list-view: don't crash on view leaks
    
    Although we all love how Nautilus keeps us on the belt crashing when
    there is a leak, users are not happy about that.
    
    So let's make nautilus more docile and don't crash in case there is a
    view leak. For that, disconnect all signals in the dispose handler
    rather than in finalize.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=772462

 src/nautilus-list-view.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/src/nautilus-list-view.c b/src/nautilus-list-view.c
index d71ef30..1b04390 100644
--- a/src/nautilus-list-view.c
+++ b/src/nautilus-list-view.c
@@ -3223,6 +3223,16 @@ nautilus_list_view_dispose (GObject *object)
 
     clipboard = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD);
     g_signal_handlers_disconnect_by_func (clipboard, on_clipboard_owner_changed, list_view);
+    g_signal_handlers_disconnect_by_func (nautilus_preferences,
+                                          default_sort_order_changed_callback,
+                                          list_view);
+    g_signal_handlers_disconnect_by_func (nautilus_list_view_preferences,
+                                          default_visible_columns_changed_callback,
+                                          list_view);
+    g_signal_handlers_disconnect_by_func (nautilus_list_view_preferences,
+                                          default_column_order_changed_callback,
+                                          list_view);
+
 
     G_OBJECT_CLASS (nautilus_list_view_parent_class)->dispose (object);
 }
@@ -3267,16 +3277,6 @@ nautilus_list_view_finalize (GObject *object)
 
     g_free (list_view->details);
 
-    g_signal_handlers_disconnect_by_func (nautilus_preferences,
-                                          default_sort_order_changed_callback,
-                                          list_view);
-    g_signal_handlers_disconnect_by_func (nautilus_list_view_preferences,
-                                          default_visible_columns_changed_callback,
-                                          list_view);
-    g_signal_handlers_disconnect_by_func (nautilus_list_view_preferences,
-                                          default_column_order_changed_callback,
-                                          list_view);
-
     G_OBJECT_CLASS (nautilus_list_view_parent_class)->finalize (object);
 }
 


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