[mutter] Free MutterWindow description string in finalize() not dispose()



commit 84059f1faaa75c003d78f5e797b95c50e4bc2765
Author: Tomas Frydrych <tf linux intel com>
Date:   Fri Aug 7 16:47:43 2009 +0100

    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 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/compositor/mutter-window.c b/src/compositor/mutter-window.c
index 4e03426..e1f7068 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);
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]