Skip to content
Commit f6e7d2ab authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

wayland: Handle xdg_wm_base being destroyed before surface role

If a client owns several windows (for example it can be the case with
plasmashell) and it crashes, it's possible to encounter the following
case:

- xdg_wm_base resources are destroyed
- xdg_toplevel is destroyed
- another xdg_toplevel is destroyed

When kwin processes the destruction of the first xdg_toplevel, it may
ping the second xdg_toplevel. But the xdg_wm_base is already free()d by
that time, so kwin can access already released memory.

In order to prevent that, make the associated XdgSurfaceInterface
objects inert. Since XdgToplevelInterface and XdgPopupInterface will
become useless after destroying XdgSurfaceInterface, make them inert too.

As the spec states, it's illegal to destroy a bound xdg_wm_base object
while there are still alive xdg surfaces created by it so destroying the
surface role objects should be fine.


(cherry picked from commit 16a07d5d)
parent 715f4147
Pipeline #360568 failed with stage
in 17 minutes and 56 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment