diff --git a/ChangeLog b/ChangeLog index 27bca62b3..e8ff7b5ac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-04-23 Emmanuele Bassi + + Bug 891 - assertion failed when test-behave exits + + * clutter/clutter-behaviour.c: + (remove_actor_on_destroy), + (clutter_behaviour_apply), + (clutter_behaviour_remove): Remove the actor if it gets + destroyed before the behaviour. + 2008-04-18 Emmanuele Bassi Bug #884 - Add clutter_alpha_set_closure diff --git a/clutter/clutter-behaviour.c b/clutter/clutter-behaviour.c index 664041b33..c5d267c38 100644 --- a/clutter/clutter-behaviour.c +++ b/clutter/clutter-behaviour.c @@ -325,6 +325,13 @@ clutter_behaviour_init (ClutterBehaviour *self) } +static void +remove_actor_on_destroy (ClutterActor *actor, + ClutterBehaviour *behaviour) +{ + clutter_behaviour_remove (behaviour, actor); +} + /** * clutter_behaviour_apply: * @behave: a #ClutterBehaviour @@ -356,6 +363,9 @@ clutter_behaviour_apply (ClutterBehaviour *behave, } priv->actors = g_slist_prepend (priv->actors, g_object_ref (actor)); + g_signal_connect (actor, "destroy", + G_CALLBACK (remove_actor_on_destroy), + behave); g_signal_emit (behave, behave_signals[APPLIED], 0, actor); } @@ -410,7 +420,11 @@ clutter_behaviour_remove (ClutterBehaviour *behave, g_type_name (G_OBJECT_TYPE (actor))); return; } - + + g_signal_handlers_disconnect_by_func (actor, + G_CALLBACK (remove_actor_on_destroy), + behave); + priv->actors = g_slist_remove (priv->actors, actor); g_signal_emit (behave, behave_signals[REMOVED], 0, actor);