From 1c06f0dc09b172769ad5bae256c5fd4f2ba9817a Mon Sep 17 00:00:00 2001 From: Pavel Vasin Date: Tue, 23 Apr 2013 13:02:04 +0400 Subject: [PATCH] background: Fix memory leak https://bugzilla.gnome.org/show_bug.cgi?id=698710 --- src/compositor/meta-background.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/compositor/meta-background.c b/src/compositor/meta-background.c index 727000f98..fca5dce60 100644 --- a/src/compositor/meta-background.c +++ b/src/compositor/meta-background.c @@ -472,6 +472,17 @@ meta_background_dispose (GObject *object) G_OBJECT_CLASS (meta_background_parent_class)->dispose (object); } +static void +meta_background_finalize (GObject *object) +{ + MetaBackground *self = META_BACKGROUND (object); + MetaBackgroundPrivate *priv = self->priv; + + g_free (priv->filename); + + G_OBJECT_CLASS (meta_background_parent_class)->finalize (object); +} + static void ensure_pipeline (MetaBackground *self) { @@ -643,6 +654,7 @@ meta_background_class_init (MetaBackgroundClass *klass) g_type_class_add_private (klass, sizeof (MetaBackgroundPrivate)); object_class->dispose = meta_background_dispose; + object_class->finalize = meta_background_finalize; object_class->set_property = meta_background_set_property; object_class->get_property = meta_background_get_property;