From 84059f1faaa75c003d78f5e797b95c50e4bc2765 Mon Sep 17 00:00:00 2001 From: Tomas Frydrych Date: Fri, 7 Aug 2009 16:47:43 +0100 Subject: [PATCH] Free MutterWindow description string in finalize() not dispose() We were freeing the description string in dispose and not setting it to NULL, thus leaving around a dangling pointer for the duration of the disposal. This commit moves the free into the finalize vfuction, where it belongs. --- src/compositor/mutter-window.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/compositor/mutter-window.c b/src/compositor/mutter-window.c index 4e034263d..e1f7068ad 100644 --- a/src/compositor/mutter-window.c +++ b/src/compositor/mutter-window.c @@ -415,14 +415,17 @@ mutter_window_dispose (GObject *object) info->windows = g_list_remove (info->windows, (gconstpointer) self); g_hash_table_remove (info->windows_by_xid, (gpointer) priv->xwindow); - g_free (priv->desc); - G_OBJECT_CLASS (mutter_window_parent_class)->dispose (object); } static void mutter_window_finalize (GObject *object) { + MutterWindow *self = MUTTER_WINDOW (object); + MutterWindowPrivate *priv = self->priv; + + g_free (priv->desc); + G_OBJECT_CLASS (mutter_window_parent_class)->finalize (object); }