[gtk/matthiasc/for-master] css: Go back to clearing out selectors



commit 4e961c6830780d3183e2bb87cfc87c0f939c6e58
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Jan 18 17:55:58 2020 -0500

    css: Go back to clearing out selectors
    
    Now that we use the selector tree for change computation
    again, we don't need the ruleset selectors anymore.
    Bring back the code that cleans them out.

 gtk/gtkcssprovider.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
---
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c
index ee5085dd3f..5201e00c0a 100644
--- a/gtk/gtkcssprovider.c
+++ b/gtk/gtkcssprovider.c
@@ -984,6 +984,18 @@ gtk_css_provider_postprocess (GtkCssProvider *css_provider)
 
   priv->tree = _gtk_css_selector_tree_builder_build (builder);
   _gtk_css_selector_tree_builder_free (builder);
+
+#ifndef VERIFY_TREE
+  for (i = 0; i < priv->rulesets->len; i++)
+    {
+      GtkCssRuleset *ruleset;
+
+      ruleset = &g_array_index (priv->rulesets, GtkCssRuleset, i);
+
+      _gtk_css_selector_free (ruleset->selector);
+      ruleset->selector = NULL;
+    }
+#endif
 }
 
 static void


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