Skip to content
Permalink
Browse files

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
  • Loading branch information...
lukefromdc committed Jul 8, 2018
1 parent acdb7e2 commit f9bae2f377579baf4715c851661879e07291e17a
Showing with 6 additions and 1 deletion.
  1. +6 −1 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;

0 comments on commit f9bae2f

Please sign in to comment.
You can’t perform that action at this time.