actor: Call unparent() in destroy

If the actor is an internal child of another actor then we should call
unparent() when destroying it, like clutter_actor_reparent() does;
otherwise we'll leak the actor, since the parent holds a reference to
it.

http://bugzilla.openedhand.com/show_bug.cgi?id=2009
This commit is contained in:
Emmanuele Bassi 2010-02-28 10:59:29 +00:00
parent 9f67e4826c
commit ce6a24eb2b

View File

@ -3067,7 +3067,7 @@ clutter_actor_dispose (GObject *object)
clutter_container_remove_actor (CLUTTER_CONTAINER (parent), self); clutter_container_remove_actor (CLUTTER_CONTAINER (parent), self);
} }
else else
priv->parent_actor = NULL; clutter_actor_unparent (self);
} }
/* parent should be gone */ /* parent should be gone */