summaryrefslogtreecommitdiff
path: root/clutter
diff options
context:
space:
mode:
authorMarco Trevisan (TreviƱo) <mail@3v1n0.net>2019-09-10 03:34:09 +0200
committerMarco Trevisan <mail@3v1n0.net>2019-10-02 17:59:22 +0000
commit105a3f757a31299ed4eaafa0615e1fcd0b4ffeec (patch)
tree6dba2ee65770e07b1d82579126780da0a9336f20 /clutter
parentf376a318ba90fc29d3d661df4f55698459f31cfa (diff)
downloadmutter-105a3f757a31299ed4eaafa0615e1fcd0b4ffeec.tar.gz
clutter/actor: Don't emit property changes after ::destroy
Clutter actors might emit property changes in dispose, while unparenting. However we assume that the ::destroy signal is the last one we emit for an actor, and that starting from this moment the object is not valid anymore, and so we don't expect any signal emission from it. To avoid this, freeze the object notifications on an actor during its disposition, just before the ::destroy signal emission. Update the actor-destroy test to verify this behavior. https://gitlab.gnome.org/GNOME/mutter/merge_requests/769
Diffstat (limited to 'clutter')
-rw-r--r--clutter/clutter/clutter-actor.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c
index 313317de3..fbef49c29 100644
--- a/clutter/clutter/clutter-actor.c
+++ b/clutter/clutter/clutter-actor.c
@@ -6069,6 +6069,9 @@ clutter_actor_dispose (GObject *object)
object->ref_count,
g_type_name (G_OBJECT_TYPE (self)));
+ /* Stop the emission of any property change */
+ g_object_freeze_notify (object);
+
g_signal_emit (self, actor_signals[DESTROY], 0);
/* avoid recursing when called from clutter_actor_destroy() */