2008-04-23 Emmanuele Bassi <ebassi@openedhand.com>

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.
This commit is contained in:
Emmanuele Bassi 2008-04-23 09:46:16 +00:00
parent 9655f4d58c
commit 4b0a15c468
2 changed files with 25 additions and 1 deletions

View File

@ -1,3 +1,13 @@
2008-04-23 Emmanuele Bassi <ebassi@openedhand.com>
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 <ebassi@openedhand.com>
Bug #884 - Add clutter_alpha_set_closure

View File

@ -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);
}
@ -411,6 +421,10 @@ clutter_behaviour_remove (ClutterBehaviour *behave,
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);