mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-17 14:30:15 +00:00
gtktreeviewaccessible: do not trigger an assertion
The following assertion was triggered in model_row_inserted() because iterate_thru_children() modifies the parameter tree_model before passing it to traverse_cells(). Gtk-CRITICAL **: gtk_tree_path_compare: assertion `b->depth > 0' failed The stack with the bug was: #0 gtk_tree_path_compare at gtktreemodel.c #1 traverse_cells at gtktreeviewaccessible.c #2 model_row_inserted at gtktreeviewaccessible.c This patch calls iterate_thru_children() with a copy of the path so that the original is not modified.
This commit is contained in:
parent
a0fc947f89
commit
6ab7b87a02
@ -2109,13 +2109,18 @@ model_row_inserted (GtkTreeModel *tree_model,
|
||||
/* Figure out number of visible children. */
|
||||
if (gtk_tree_model_iter_has_child (tree_model, &tmp_iter))
|
||||
{
|
||||
GtkTreePath *path2;
|
||||
/*
|
||||
* By passing path into this function, we find the number of
|
||||
* visible children of path.
|
||||
*/
|
||||
n_inserted = 0;
|
||||
/* iterate_thru_children modifies path, we don't want that, so give
|
||||
* it a copy */
|
||||
path2 = gtk_tree_path_copy (path);
|
||||
iterate_thru_children (tree_view, tree_model,
|
||||
path, NULL, &n_inserted, 0);
|
||||
path2, NULL, &n_inserted, 0);
|
||||
gtk_tree_path_free (path2);
|
||||
|
||||
/* Must add one to include the row that is being added */
|
||||
n_inserted++;
|
||||
@ -2620,6 +2625,7 @@ set_iter_nth_row (GtkTreeView *tree_view,
|
||||
*
|
||||
* *count will be set to the visible row number of the child
|
||||
* relative to the row that was initially passed in as tree_path.
|
||||
* tree_path could be modified by this function.
|
||||
*
|
||||
* *count will be -1 if orig is not found as a child (a row that is
|
||||
* not visible will not be found, e.g. if the row is inside a
|
||||
|
Loading…
Reference in New Issue
Block a user