From 6825b9db1c1eaeab151d4ca9cc4f5ec923cbcde0 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 3 Jun 2009 12:59:16 +0100 Subject: [PATCH] [actor] Unrealize on destroy If the application code calls for destruction of an actor we need to make sure that the actor is unrealized before running the dispose sequence; otherwise, we might trigger an assertion failure on composite actors. --- clutter/clutter-actor.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index ac3f42dad..b57b41c0d 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -4269,6 +4269,11 @@ clutter_actor_destroy (ClutterActor *self) { CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_ACTOR_IN_DESTRUCTION); + /* if we are destroying we want to unrealize ourselves + * first before the dispose run removes the parent + */ + clutter_actor_update_map_state (self, MAP_STATE_MAKE_UNREALIZED); + g_object_run_dispose (G_OBJECT (self)); CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_ACTOR_IN_DESTRUCTION);