[gtk+/gtk-style-context: 241/276] Plug some leaks.
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-style-context: 241/276] Plug some leaks.
- Date: Sat, 23 Oct 2010 19:15:23 +0000 (UTC)
commit 03516e6e6ee3b712bfa6b775a2899c66df891e44
Author: Carlos Garnacho <carlosg gnome org>
Date: Wed Oct 6 01:04:06 2010 +0200
Plug some leaks.
gtk/gtk9slice.c | 4 ++++
gtk/gtkcssprovider.c | 17 +++++++++++++----
gtk/gtksettings.c | 6 ++++--
3 files changed, 21 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtk9slice.c b/gtk/gtk9slice.c
index 9bfdafb..7cd6ad4 100644
--- a/gtk/gtk9slice.c
+++ b/gtk/gtk9slice.c
@@ -177,6 +177,8 @@ gtk_9slice_new (GdkPixbuf *pixbuf,
cairo_paint (cr);
cairo_destroy (cr);
+ cairo_surface_destroy (surface);
+
return slice;
}
@@ -217,6 +219,8 @@ render_border (cairo_t *cr,
cairo_rectangle (cr, x, y, width, height);
cairo_fill (cr);
+ cairo_pattern_destroy (pattern);
+
cairo_restore (cr);
}
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c
index d5d552c..8236022 100644
--- a/gtk/gtkcssprovider.c
+++ b/gtk/gtkcssprovider.c
@@ -1239,6 +1239,7 @@ symbolic_color_parse_str (const gchar *string,
}
symbolic_color = gtk_symbolic_color_new_shade (param_color, factor);
+ gtk_symbolic_color_unref (param_color);
(*end_ptr)++;
}
else if (g_str_has_prefix (str, "mix"))
@@ -1309,6 +1310,8 @@ symbolic_color_parse_str (const gchar *string,
}
symbolic_color = gtk_symbolic_color_new_mix (color1, color2, factor);
+ gtk_symbolic_color_unref (color1);
+ gtk_symbolic_color_unref (color2);
(*end_ptr)++;
}
@@ -1617,6 +1620,7 @@ slice_parse_str (GtkCssProvider *css_provider,
GtkSliceSideModifier mods[2];
GError *error = NULL;
GdkPixbuf *pixbuf;
+ Gtk9Slice *slice;
gchar *path;
gint i = 0;
@@ -1640,6 +1644,8 @@ slice_parse_str (GtkCssProvider *css_provider,
full_path = g_build_filename (dirname, path, NULL);
g_free (path);
+ g_free (dirname);
+
path = full_path;
}
@@ -1715,10 +1721,13 @@ slice_parse_str (GtkCssProvider *css_provider,
return NULL;
}
- return gtk_9slice_new (pixbuf,
- distance_top, distance_bottom,
- distance_left, distance_right,
- mods[0], mods[1]);
+ slice = gtk_9slice_new (pixbuf,
+ distance_top, distance_bottom,
+ distance_left, distance_right,
+ mods[0], mods[1]);
+ g_object_unref (pixbuf);
+
+ return slice;
}
static Gtk9Slice *
diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c
index 2452168..970c4e1 100644
--- a/gtk/gtksettings.c
+++ b/gtk/gtksettings.c
@@ -1240,6 +1240,7 @@ gtk_settings_get_style (GtkStyleProvider *provider,
for (i = 0; colors[i]; i++)
{
+ GtkSymbolicColor *color;
gchar *name, *pos;
GdkColor col;
@@ -1263,8 +1264,9 @@ gtk_settings_get_style (GtkStyleProvider *provider,
if (!*pos || !gdk_color_parse (pos, &col))
continue;
- gtk_style_set_map_color (set, name,
- gtk_symbolic_color_new_literal (&col));
+ color = gtk_symbolic_color_new_literal (&col);
+ gtk_style_set_map_color (set, name, color);
+ gtk_symbolic_color_unref (color);
}
font_desc = pango_font_description_from_string (font_name);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]