diff options
author | Carlos Soriano <csoriano@gnome.org> | 2016-10-05 19:40:50 +0200 |
---|---|---|
committer | Carlos Soriano <csoriano@gnome.org> | 2016-10-05 20:36:37 +0200 |
commit | 6015ea403f1e4412f779bec1775a2ccbe3fe5d2a (patch) | |
tree | 0960352d17a584559baf0d990baed557bb74901f | |
parent | dd78529457d6d4081a10983063afbb46b9672ff5 (diff) | |
download | nautilus-6015ea403f1e4412f779bec1775a2ccbe3fe5d2a.tar.gz |
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
-rw-r--r-- | 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 d71ef3074..1b04390ad 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); } |