Skip to content

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.

Merge request reports