window: Fix criticals when moving file to trash

The "gtk_revealer_get_transition_type: assertion 'GTK_IS_REVEALER (revealer)'
failed" critical is printed when moving file to trash after closing a window.
This is because the "undo-changed" signal handler is not disconnected when
the window is destroyed. Let's use g_signal_connect_object() to ensure
disconnection and prevent those criticals.

Fixes: https://gitlab.gnome.org/GNOME/nautilus/issues/1076
This commit is contained in:
Ondrej Holy 2019-09-25 09:16:44 +02:00 committed by Ernestas Kulik
parent 4d329a9a54
commit 668e0673a7

View file

@ -2239,8 +2239,9 @@ nautilus_window_constructed (GObject *self)
nautilus_window_set_up_sidebar (window);
g_signal_connect_after (nautilus_file_undo_manager_get (), "undo-changed",
G_CALLBACK (nautilus_window_on_undo_changed), self);
g_signal_connect_object (nautilus_file_undo_manager_get (), "undo-changed",
G_CALLBACK (nautilus_window_on_undo_changed), self,
G_CONNECT_AFTER);
/* Is required that the UI is constructed before initializating the actions, since
* some actions trigger UI widgets to show/hide. */