[gtk+] treemodelfilter: add additional asserts to MODEL_FILTER_DEBUG mode
- From: Kristian Rietveld <kristian src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] treemodelfilter: add additional asserts to MODEL_FILTER_DEBUG mode
- Date: Sat, 17 Sep 2011 04:19:18 +0000 (UTC)
commit e1ede022f87e6fe7c2d4be29e61ce9be8866d24f
Author: Kristian Rietveld <kris gtk org>
Date: Sat Sep 17 06:08:40 2011 +0200
treemodelfilter: add additional asserts to MODEL_FILTER_DEBUG mode
gtk/gtktreemodelfilter.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtktreemodelfilter.c b/gtk/gtktreemodelfilter.c
index cee7777..3eb85e5 100644
--- a/gtk/gtktreemodelfilter.c
+++ b/gtk/gtktreemodelfilter.c
@@ -1007,6 +1007,11 @@ gtk_tree_model_filter_free_level (GtkTreeModelFilter *filter,
filter->priv->zero_ref_count--;
}
+#ifdef MODEL_FILTER_DEBUG
+ if (filter_level == filter->priv->root)
+ g_assert (filter->priv->zero_ref_count == 0);
+#endif
+
if (filter_level->parent_elt)
{
/* Release reference on parent */
@@ -3493,6 +3498,8 @@ gtk_tree_model_filter_real_ref_node (GtkTreeModel *model,
#ifdef MODEL_FILTER_DEBUG
g_assert (filter->priv->zero_ref_count >= 0);
+ if (filter->priv->zero_ref_count > 0)
+ g_assert (filter->priv->root != NULL);
#endif
}
}
@@ -3569,6 +3576,8 @@ gtk_tree_model_filter_real_unref_node (GtkTreeModel *model,
#ifdef MODEL_FILTER_DEBUG
g_assert (filter->priv->zero_ref_count >= 0);
+ if (filter->priv->zero_ref_count > 0)
+ g_assert (filter->priv->root != NULL);
#endif
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]