]> Pileus Git - ~andy/gtk/commitdiff
gtkstyleproperty: Plug two leaks
authorCarlos Garnacho <carlosg@gnome.org>
Mon, 30 May 2011 17:21:42 +0000 (19:21 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Mon, 30 May 2011 17:21:42 +0000 (19:21 +0200)
In rgba_value_parse(), unref the symbolic color once we've resolved it.
In gradient_value_parse(), take the GtkGradient so we leave no dangling
references.

gtk/gtkstyleproperty.c

index 7ad23992fbdbbb273402fa614145ab00c1674e2f..65cd58b6ae1b3d9672b1ab57673706b74aab5b0e 100644 (file)
@@ -77,6 +77,7 @@ rgba_value_parse (GtkCssParser *parser,
   if (gtk_symbolic_color_resolve (symbolic, NULL, &rgba))
     {
       g_value_set_boxed (value, &rgba);
+      gtk_symbolic_color_unref (symbolic);
     }
   else
     {
@@ -711,7 +712,7 @@ gradient_value_parse (GtkCssParser *parser,
       return FALSE;
     }
 
-  g_value_set_boxed (value, gradient);
+  g_value_take_boxed (value, gradient);
   return TRUE;
 }