bring zero ref count loops in sync with each other and the sort model.

2006-09-26  Kristian Rietveld  <kris@imendio.com>

	* gtk/gtktreemodelfilter.c (gtk_tree_model_filter_free_level),
	(gtk_tree_model_filter_ref_node),
	(gtk_tree_model_filter_real_unref_node): bring zero ref count loops
	in sync with each other and the sort model.
This commit is contained in:
Kristian Rietveld 2006-09-27 14:16:47 +00:00 committed by Kristian Rietveld
parent 2d7405d9c6
commit 38dc73faee
2 changed files with 22 additions and 20 deletions

View File

@ -1,3 +1,10 @@
2006-09-26 Kristian Rietveld <kris@imendio.com>
* gtk/gtktreemodelfilter.c (gtk_tree_model_filter_free_level),
(gtk_tree_model_filter_ref_node),
(gtk_tree_model_filter_real_unref_node): bring zero ref count loops
in sync with each other and the sort model.
2006-09-26 Kristian Rietveld <kris@imendio.com>
* gtk/gtktreemodelfilter.c (gtk_tree_model_filter_init),

View File

@ -629,18 +629,14 @@ gtk_tree_model_filter_free_level (GtkTreeModelFilter *filter,
FilterLevel *parent_level = filter_level->parent_level;
FilterElt *parent_elt = filter_level->parent_elt;
do
while (parent_level)
{
if (parent_elt)
parent_elt->zero_ref_count--;
parent_elt->zero_ref_count--;
if (parent_level)
{
parent_elt = parent_level->parent_elt;
parent_level = parent_level->parent_level;
}
parent_elt = parent_level->parent_elt;
parent_level = parent_level->parent_level;
}
while (parent_level);
if (filter_level != filter->priv->root)
filter->priv->zero_ref_count--;
}
@ -2574,19 +2570,16 @@ gtk_tree_model_filter_ref_node (GtkTreeModel *model,
FilterElt *parent_elt = level->parent_elt;
/* we were at zero -- time to decrease the zero_ref_count val */
do
while (parent_level)
{
if (parent_elt)
parent_elt->zero_ref_count--;
parent_elt->zero_ref_count--;
if (parent_level)
{
parent_elt = parent_level->parent_elt;
parent_level = parent_level->parent_level;
}
parent_elt = parent_level->parent_elt;
parent_level = parent_level->parent_level;
}
while (parent_level);
filter->priv->zero_ref_count--;
if (filter->priv->root != level)
filter->priv->zero_ref_count--;
}
}
@ -2637,7 +2630,9 @@ gtk_tree_model_filter_real_unref_node (GtkTreeModel *model,
parent_elt = parent_level->parent_elt;
parent_level = parent_level->parent_level;
}
filter->priv->zero_ref_count++;
if (filter->priv->root != level)
filter->priv->zero_ref_count++;
}
}