Skip to content

Fix a crash in Workspace::cleanupX11()

Vlad Zahorodnii requested to merge work/fix-crash-in-cleanup-x11 into master

When we destroy all internal clients and override-redirect windows, we assume that corresponding lists will be implicitly detached.

However, in some cases, that might be not the case. For example, if the list is not shared, neither begin() nor end() will detach. Therefore, it is possible to hit invalidated iterators if the list gets modified inside the loop.

This change prevents hitting invalidated iterators by making explicit list copies.

Edited by Vlad Zahorodnii

Merge request reports