diff options
author | Tristan Van Berkom <tristan.van.berkom@gmail.com> | 2011-01-16 20:17:52 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.van.berkom@gmail.com> | 2011-01-16 20:17:52 +0900 |
commit | c35fb706bddd5e76dfec2964d67f3aa1ba5a169b (patch) | |
tree | 00f019b536c1810262c5c17a88a3b591511b68cb /gtk/gtkstyle.c | |
parent | 4a5c435e9a0906220060439db5e8b83ea1d04cb2 (diff) | |
download | gtk+-c35fb706bddd5e76dfec2964d67f3aa1ba5a169b.tar.gz |
Plugged memory leak in gtk_style_finalize (destroy the ->background[] patterns).
Diffstat (limited to 'gtk/gtkstyle.c')
-rw-r--r-- | gtk/gtkstyle.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gtk/gtkstyle.c b/gtk/gtkstyle.c index f9abf8d9c3..9fd3bfbe6f 100644 --- a/gtk/gtkstyle.c +++ b/gtk/gtkstyle.c @@ -513,6 +513,7 @@ gtk_style_finalize (GObject *object) { GtkStyle *style = GTK_STYLE (object); GtkStylePrivate *priv = GTK_STYLE_GET_PRIVATE (style); + gint i; g_return_if_fail (style->attach_count == 0); @@ -559,6 +560,12 @@ gtk_style_finalize (GObject *object) g_object_unref (priv->context); } + for (i = 0; i < 5; i++) + { + if (style->background[i]) + cairo_pattern_destroy (style->background[i]); + } + G_OBJECT_CLASS (gtk_style_parent_class)->finalize (object); } |