Commit 7db91295 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Figure out nested wayland dismantle

Summary:
Fixes a crash we would get, we're changing 2 main things:
- release the event queue first, otherwise we'd serve events to
disappearing objects.
- destroy the connection thread object after the thread has quit.

Test Plan: KWin doesn't explode when closing.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D28340
parent 5498ed95
......@@ -463,6 +463,7 @@ WaylandBackend::~WaylandBackend()
}
delete m_waylandCursor;
m_eventQueue->release();
qDeleteAll(m_outputs);
if (m_xdgShell) {
......@@ -473,11 +474,10 @@ WaylandBackend::~WaylandBackend()
m_registry->release();
delete m_seat;
m_shm->release();
m_eventQueue->release();
m_connectionThreadObject->deleteLater();
m_connectionThread->quit();
m_connectionThread->wait();
m_connectionThreadObject->deleteLater();
qCDebug(KWIN_WAYLAND_BACKEND) << "Destroyed Wayland display";
}
......
Markdown is supported
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