[gtk+] gtkcssprovider: Free shorthand border GValues in the right place



commit 20433efbfaf462ac155b90a64a5e83c9a3b3f2e1
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon May 30 19:29:22 2011 +0200

    gtkcssprovider: Free shorthand border GValues in the right place
    
    The call to gtk_border_free() within unpack_border() felt completely
    in the wrong place, as the border actually pertains to the GValue
    being unpacked. Plus, the GValue itself was also being leaked.

 gtk/gtkcssprovider.c   |    1 +
 gtk/gtkstyleproperty.c |    2 --
 2 files changed, 1 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c
index e1b9b33..2893521 100644
--- a/gtk/gtkcssprovider.c
+++ b/gtk/gtkcssprovider.c
@@ -1092,6 +1092,7 @@ gtk_css_ruleset_add (GtkCssRuleset          *ruleset,
           gtk_css_ruleset_add (ruleset, child, value);
         }
       g_free (parameters);
+      property_value_free (value);
       return;
     }
 
diff --git a/gtk/gtkstyleproperty.c b/gtk/gtkstyleproperty.c
index 65cd58b..b2fa41f 100644
--- a/gtk/gtkstyleproperty.c
+++ b/gtk/gtkstyleproperty.c
@@ -1187,8 +1187,6 @@ unpack_border (const GValue *value,
   g_value_init (&parameter[3].value, G_TYPE_INT);
   g_value_set_int (&parameter[3].value, border->right);
 
-  gtk_border_free (border);
-
   *n_params = 4;
   return parameter;
 }



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