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.
This commit is contained in:
Tomas Frydrych 2009-08-07 16:47:43 +01:00
parent 15376957f7
commit 84059f1faa

View File

@ -415,14 +415,17 @@ mutter_window_dispose (GObject *object)
info->windows = g_list_remove (info->windows, (gconstpointer) self); info->windows = g_list_remove (info->windows, (gconstpointer) self);
g_hash_table_remove (info->windows_by_xid, (gpointer) priv->xwindow); g_hash_table_remove (info->windows_by_xid, (gpointer) priv->xwindow);
g_free (priv->desc);
G_OBJECT_CLASS (mutter_window_parent_class)->dispose (object); G_OBJECT_CLASS (mutter_window_parent_class)->dispose (object);
} }
static void static void
mutter_window_finalize (GObject *object) 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); G_OBJECT_CLASS (mutter_window_parent_class)->finalize (object);
} }