[gnome-builder] tree: be more defensive in development builds



commit 6050c3462620e8b6cad2ff970f66c9ec190bbeaa
Author: Christian Hergert <chergert redhat com>
Date:   Wed Oct 14 15:24:58 2015 -0700

    tree: be more defensive in development builds
    
    Add some more assertions to ensure we have valid filter data.

 src/tree/gb-tree.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/tree/gb-tree.c b/src/tree/gb-tree.c
index c141eeb..89c9f5b 100644
--- a/src/tree/gb-tree.c
+++ b/src/tree/gb-tree.c
@@ -1654,6 +1654,10 @@ gb_tree_model_filter_visible_func (GtkTreeModel *model,
   FilterFunc *filter = data;
   gboolean ret;
 
+  g_assert (filter != NULL);
+  g_assert (GB_IS_TREE (filter->self));
+  g_assert (filter->filter_func != NULL);
+
   /*
    * This is a rather complex situation.
    *
@@ -1719,6 +1723,7 @@ gb_tree_set_filter (GbTree           *self,
       GtkTreeModel *filter;
 
       data = g_new0 (FilterFunc, 1);
+      data->self = self;
       data->filter_func = filter_func;
       data->filter_data = filter_data;
       data->filter_data_destroy = filter_data_destroy;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]