Skip to content


pathbar: increase reference count of path in update_button_types
Browse files Browse the repository at this point in the history
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
  • Loading branch information
lukefromdc committed Jul 11, 2018
1 parent acdb7e2 commit f9bae2f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/caja-pathbar.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
if (path != NULL)
caja_path_bar_update_path (path_bar, path, TRUE);
g_object_unref (path);

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit f9bae2f

Please sign in to comment.