actor: Change the point of emission of ::destroy
Currently, we're emitting the ClutterActor::destroy at the end of the dispose implementation - right before we chain up to the parent implementation. The point of emission makes the ::destroy signal handlers able to just use the actor pointer - as the actor state will have been mostly cleared by the time application can run. This (undocumented) behaviour severely limits the amount of things you can do inside a ::destroy signal handler, thus making the ::destroy signal just a weird weak reference, instead of a proper way to break application reference cycles. Given that this change relaxes some of the conditions, this change should be safe - obviously, if anything happens, we'll back it out; the conformance and interactive tests confirm that, for common patterns of usage, this change does not break existing code.
This commit is contained in:
parent
fa39f67eab
commit
95d3e0f962
@ -3713,6 +3713,8 @@ clutter_actor_dispose (GObject *object)
|
|||||||
g_type_name (G_OBJECT_TYPE (self)),
|
g_type_name (G_OBJECT_TYPE (self)),
|
||||||
object->ref_count);
|
object->ref_count);
|
||||||
|
|
||||||
|
g_signal_emit (self, actor_signals[DESTROY], 0);
|
||||||
|
|
||||||
/* avoid recursing when called from clutter_actor_destroy() */
|
/* avoid recursing when called from clutter_actor_destroy() */
|
||||||
if (priv->parent_actor != NULL)
|
if (priv->parent_actor != NULL)
|
||||||
{
|
{
|
||||||
@ -3746,8 +3748,6 @@ clutter_actor_dispose (GObject *object)
|
|||||||
g_clear_object (&priv->effects);
|
g_clear_object (&priv->effects);
|
||||||
g_clear_object (&priv->flatten_effect);
|
g_clear_object (&priv->flatten_effect);
|
||||||
|
|
||||||
g_signal_emit (self, actor_signals[DESTROY], 0);
|
|
||||||
|
|
||||||
G_OBJECT_CLASS (clutter_actor_parent_class)->dispose (object);
|
G_OBJECT_CLASS (clutter_actor_parent_class)->dispose (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user