Revert "Unparent rather than destroy MutterWindows."

This reverts commit 16d49695ad.

If we want an actor to go away deterministically, we should call
clutter_actor_destroy(); using unparent instead a) may result
leaks through cyclic ref counts, and b) will delay the deallocation
of the window texture in a garbage collected environment until
the next garbage collection, causing much greater transient use
of memory.

http://bugzilla.gnome.org/show_bug.cgi?id=580520
This commit is contained in:
Owen W. Taylor 2009-04-27 18:34:52 -04:00
parent 321b40a386
commit 072ec184d3

View File

@ -1130,14 +1130,7 @@ mutter_window_effect_completed (MutterWindow *cw, gulong event)
if (priv->needs_destroy && effect_in_progress (cw, TRUE) == FALSE)
{
ClutterActor *cwa = CLUTTER_ACTOR (cw);
ClutterActor *parent = clutter_actor_get_parent (cwa);
if (CLUTTER_IS_CONTAINER (parent))
clutter_container_remove_actor (CLUTTER_CONTAINER (parent), cwa);
else
clutter_actor_unparent (cwa);
clutter_actor_destroy (CLUTTER_ACTOR (cw));
return;
}
@ -1201,14 +1194,7 @@ destroy_win (MutterWindow *cw)
/*
* No effects, just kill it.
*/
ClutterActor *cwa = CLUTTER_ACTOR (cw);
ClutterActor *parent = clutter_actor_get_parent (cwa);
if (CLUTTER_IS_CONTAINER (parent))
clutter_container_remove_actor (CLUTTER_CONTAINER (parent), cwa);
else
clutter_actor_unparent (cwa);
clutter_actor_destroy (CLUTTER_ACTOR (cw));
return;
}
@ -1238,15 +1224,7 @@ destroy_win (MutterWindow *cw)
priv->needs_destroy = TRUE;
}
else
{
ClutterActor *cwa = CLUTTER_ACTOR (cw);
ClutterActor *parent = clutter_actor_get_parent (cwa);
if (CLUTTER_IS_CONTAINER (parent))
clutter_container_remove_actor (CLUTTER_CONTAINER (parent), cwa);
else
clutter_actor_unparent (cwa);
}
clutter_actor_destroy (CLUTTER_ACTOR (cw));
}
}