[gtk/wip/baedert/for-master: 21/29] cssstaticstyle: Avoid ref'ing specified value in compute_value



commit 6231052e44289f8098dc821817d01af6cbe65329
Author: Timm Bäder <mail baedert org>
Date:   Thu Aug 22 12:14:33 2019 +0200

    cssstaticstyle: Avoid ref'ing specified value in compute_value
    
    There are alerady _get functions for GtkCssInheritValue and
    GtkCssInitialValue, so use those. We can avoid a ref+unref pair this
    way.

 gtk/gtkcssstaticstyle.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
---
diff --git a/gtk/gtkcssstaticstyle.c b/gtk/gtkcssstaticstyle.c
index 7f7eba14ab..f2e0b1db16 100644
--- a/gtk/gtkcssstaticstyle.c
+++ b/gtk/gtkcssstaticstyle.c
@@ -219,19 +219,14 @@ gtk_css_static_style_compute_value (GtkCssStaticStyle *style,
       GtkCssStyleProperty *prop = _gtk_css_style_property_lookup_by_id (id);
 
       if (_gtk_css_style_property_is_inherit (prop))
-        specified = _gtk_css_inherit_value_new ();
+        specified = _gtk_css_inherit_value_get ();
       else
-        specified = _gtk_css_initial_value_new ();
+        specified = _gtk_css_initial_value_get ();
     }
-  else
-    _gtk_css_value_ref (specified);
 
   value = _gtk_css_value_compute (specified, id, provider, (GtkCssStyle *)style, parent_style);
 
   gtk_css_static_style_set_value (style, id, value, section);
-  value = NULL;
-
-  _gtk_css_value_unref (specified);
 }
 
 GtkCssChange


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