Avoding releasing closed windows twice when shutting down X11 logic

The stack may contain an already closed window, in which case do nothing.
This commit is contained in:
Vlad Zahorodnii 2023-12-19 17:47:51 +02:00
parent d301106aef
commit edaee17a16

View file

@ -413,7 +413,7 @@ void Workspace::cleanupX11()
// Use stacking_order, so that kwin --replace keeps stacking order.
const auto stack = stacking_order;
for (Window *window : stack) {
if (auto x11 = qobject_cast<X11Window *>(window)) {
if (auto x11 = qobject_cast<X11Window *>(window); x11 && !x11->isDeleted()) {
x11->releaseWindow(true);
removeFromStack(window);
}