Skip to content

x11: Avoid poking MetaCompositor during MetaDisplay destruction

Commit 9c3b130f changed slightly destruction order to handle use-after-free situations, but missed a small new one introduced by the order change: The MetaX11Display may schedule callbacks through MetaLaters, which depend on the MetaCompositor, which is now freed before the MetaX11Display.

Since there is no winning move here, make the MetaX11Display aware of this by avoiding to remove the callback if the MetaCompositor is already gone. The MetaLaters infrastructure is already fully freed at this point (incl. the data it contained), so this shouldn't be a leak.

Fixes: 9c3b130f ("display: Fix destruction order")

Merge request reports