treemodelsort: destroy the root only if we are removing the latest row of the level
GtkIconView doesn't ref the rows of the model so we have to make sure that a level is actually empty before destroying it. https://bugzilla.gnome.org/show_bug.cgi?id=698846
This commit is contained in:
@ -1061,7 +1061,7 @@ gtk_tree_model_sort_row_deleted (GtkTreeModel *s_model,
|
||||
gtk_tree_model_sort_free_level (tree_model_sort,
|
||||
elt->children, FALSE);
|
||||
|
||||
if (level->ref_count == 0)
|
||||
if (level->ref_count == 0 && g_sequence_get_length (level->seq) == 1)
|
||||
{
|
||||
gtk_tree_model_sort_increment_stamp (tree_model_sort);
|
||||
gtk_tree_model_row_deleted (GTK_TREE_MODEL (data), path);
|
||||
|
||||
Reference in New Issue
Block a user