diff options
author | Ondrej Holy <oholy@redhat.com> | 2022-03-18 14:48:10 +0100 |
---|---|---|
committer | António Fernandes <antoniof@gnome.org> | 2022-03-19 13:16:55 +0000 |
commit | be58480dd23ed417dc283d59f03e395d41479e12 (patch) | |
tree | c621468edc736676cb71c699817690c34f27a3c5 | |
parent | d5aeba0f2fb5c66b23fcc5ad308f32d46d53f8d8 (diff) | |
download | nautilus-be58480dd23ed417dc283d59f03e395d41479e12.tar.gz |
pathbar: Disconnect signals when disposing to avoid crashes
The path bar buttons are updated when the corresponding files are changed.
Unfortunately, the "changed" signals are not disconnected when destroying the
path bar. This can lead to crashes. Let's explicitly disconnect the signals
when disposing of the buttons.
Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/2192
-rw-r--r-- | src/nautilus-pathbar.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nautilus-pathbar.c b/src/nautilus-pathbar.c index 4dea6168f..04420474b 100644 --- a/src/nautilus-pathbar.c +++ b/src/nautilus-pathbar.c @@ -131,6 +131,7 @@ static void action_pathbar_properties (GSimpleAction *action, gpointer user_data); static void pop_up_pathbar_context_menu (NautilusPathBar *self, NautilusFile *file); +static void nautilus_path_bar_clear_buttons (NautilusPathBar *self); const GActionEntry path_bar_actions[] = { @@ -309,7 +310,6 @@ nautilus_path_bar_finalize (GObject *object) self = NAUTILUS_PATH_BAR (object); - g_list_free (self->button_list); g_clear_object (&self->current_view_menu); g_clear_object (&self->extensions_section); g_clear_object (&self->templates_submenu); @@ -342,6 +342,7 @@ nautilus_path_bar_dispose (GObject *object) self = NAUTILUS_PATH_BAR (object); remove_settings_signal (self, gtk_widget_get_screen (GTK_WIDGET (object))); + nautilus_path_bar_clear_buttons (self); G_OBJECT_CLASS (nautilus_path_bar_parent_class)->dispose (object); } |