Plug some leaks.

This commit is contained in:
Carlos Garnacho 2010-10-06 01:04:06 +02:00
parent 5c8a818671
commit 5c2cf1e934
3 changed files with 21 additions and 6 deletions

View File

@ -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);
}

View File

@ -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 *

View File

@ -1276,6 +1276,7 @@ gtk_settings_get_style (GtkStyleProvider *provider,
for (i = 0; colors[i]; i++)
{
GtkSymbolicColor *color;
gchar *name, *pos;
GdkColor col;
@ -1299,8 +1300,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);