From f9bae2f377579baf4715c851661879e07291e17a Mon Sep 17 00:00:00 2001 From: lukefromdc Date: Sun, 8 Jul 2018 16:02:14 -0400 Subject: pathbar: increase reference count of path in update_button_types Stop crash and g_object_ref: assertion 'G_IS_OBJECT (object)' failed warnings on toggling desktop_is_home_dir and on some window opening events --- src/caja-pathbar.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/caja-pathbar.c') diff --git a/src/caja-pathbar.c b/src/caja-pathbar.c index db854cab..b5f7a526 100644 --- a/src/caja-pathbar.c +++ b/src/caja-pathbar.c @@ -169,13 +169,17 @@ update_button_types (CajaPathBar *path_bar) button_data = BUTTON_DATA (list->data); if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button_data->button))) { - path = button_data->path; + /*Increase the reference count on path so it does not get cleared + *by caja_path_bar_clear_buttons during caja_path_bar_update_path + */ + path = g_object_ref (button_data->path); break; } } if (path != NULL) { caja_path_bar_update_path (path_bar, path, TRUE); + g_object_unref (path); } } @@ -2103,6 +2107,7 @@ caja_path_bar_update_path (CajaPathBar *path_bar, } path_bar->current_path = g_object_ref (file_path); + path_bar->current_button_data = current_button_data; return result; -- cgit v1.2.1