Skip to content

clutter/actor: Don't emit signals and property notifications after 'destroy'

Marco Trevisan requested to merge 3v1n0/mutter:destroy-after-parent-unset into master

Clutter actors unset their parent in dispose, after emitting the ::destroy signal, however this could cause the ::parent-set and ::notify signals emission. Since we assume that after the destruction has been completed the actor isn't valid anymore, and that during the destroy phase we do all the signal / source disconnections, this might create unwanted behaviors, as in the signal callbacks we always assume that the actor isn't in disposed yet.

To avoid this, don't emit ::parent-set signal or don't notify if it's being destroyed.

Update the actor-destroy test to verify this behavior.


This Fixes errors we're getting when an idle or a later is added on ::parent-set (like here) and that will try to access to the actor that has just been destroyed, as if this happens after 'destroy' it will be just kept running.

Edited by Marco Trevisan

Merge request reports