summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Borelli <pborelli@gnome.org>2015-09-05 10:15:51 +0200
committerPaolo Borelli <pborelli@gnome.org>2015-09-05 10:27:59 +0200
commite5bc293fd757d2d2f335c8d3210d76aac6a2590d (patch)
tree9dda58af6d62f5a217b8308e399da2cded33ec6b
parent76c5cad4787fc240f3394708e7c410fff0f4b7a0 (diff)
downloadgtksourceview-e5bc293fd757d2d2f335c8d3210d76aac6a2590d.tar.gz
Plug a small leak in the style scheme code
gtk_style_context_get returns a copy
-rw-r--r--gtksourceview/gtksourcestylescheme.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/gtksourceview/gtksourcestylescheme.c b/gtksourceview/gtksourcestylescheme.c
index 544ed800..75917978 100644
--- a/gtksourceview/gtksourcestylescheme.c
+++ b/gtksourceview/gtksourcestylescheme.c
@@ -670,18 +670,21 @@ get_cursors_css_style (GtkSourceStyleScheme *scheme,
if (!get_color (secondary_style, TRUE, &secondary_color))
{
GtkStyleContext *context;
+ GdkRGBA *rgba;
context = gtk_widget_get_style_context (widget);
gtk_style_context_get (context,
GTK_STATE_FLAG_NORMAL,
- "background-color", &secondary_color,
+ "background-color", &rgba,
NULL);
/* shade the secondary cursor */
- secondary_color.red *= 0.5;
- secondary_color.green *= 0.5;
- secondary_color.blue *= 0.5;
+ secondary_color.red = rgba->red * 0.5;
+ secondary_color.green = rgba->green * 0.5;
+ secondary_color.blue = rgba->blue * 0.5;
+
+ gdk_rgba_free (rgba);
}
primary_color_str = gdk_rgba_to_string (&primary_color);