[gtk/wip/baedert/for-master: 38/43] cssstaticstyle: Make set_value (transfer-full)



commit b3836c086acb1cb55cbe0609e5ea25c51a548ed6
Author: Timm Bäder <mail baedert org>
Date:   Sat Aug 17 19:08:16 2019 +0200

    cssstaticstyle: Make set_value (transfer-full)
    
    We only call this in one place and we can avoid a ref + unref pair this
    way.

 gtk/gtkcssstaticstyle.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkcssstaticstyle.c b/gtk/gtkcssstaticstyle.c
index ef6ac593b6..7f7eba14ab 100644
--- a/gtk/gtkcssstaticstyle.c
+++ b/gtk/gtkcssstaticstyle.c
@@ -115,7 +115,8 @@ gtk_css_static_style_set_value (GtkCssStaticStyle *style,
 {
   if (style->values[id])
     _gtk_css_value_unref (style->values[id]);
-  style->values[id] = _gtk_css_value_ref (value);
+
+  style->values[id] = value;
 
   if (style->sections && style->sections->len > id && g_ptr_array_index (style->sections, id))
     {
@@ -228,8 +229,8 @@ gtk_css_static_style_compute_value (GtkCssStaticStyle *style,
   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 (value);
   _gtk_css_value_unref (specified);
 }
 


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