diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c index ddffae3ea..83fcb49b6 100644 --- a/src/compositor/meta-window-actor.c +++ b/src/compositor/meta-window-actor.c @@ -497,6 +497,12 @@ meta_window_actor_dispose (GObject *object) info->windows = g_list_remove (info->windows, (gconstpointer) self); + if (priv->window) + { + g_object_unref (priv->window); + priv->window = NULL; + } + /* * Release the extra reference we took on the actor. */ @@ -529,7 +535,11 @@ meta_window_actor_set_property (GObject *object, switch (prop_id) { case PROP_META_WINDOW: - priv->window = g_value_get_object (value); + { + if (priv->window) + g_object_unref (priv->window); + priv->window = g_value_dup_object (value); + } break; case PROP_META_SCREEN: priv->screen = g_value_get_pointer (value);