Commit 06433997 authored by Martin Flöser's avatar Martin Flöser

Emit connectionDied on all Wayland connections of plugins on teardown

Summary:
Some libraries loaded into KWin (e.g. breeze) also have a Wayland
connection. If KWin destroyes it's own Wayland connection before the
libraries destroy theirs, KWin might crash on tear down when the
libraries call into libwayland with an invalid connection.

This change requires D6569 in KWayland.

Reviewers: #kwin, #plasma

Subscribers: plasma-devel, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D6571
parent 777f7009
......@@ -90,6 +90,15 @@ void WaylandServer::destroyInternalConnection()
{
emit terminatingInternalClientConnection();
if (m_internalConnection.client) {
// delete all connections hold by plugins like e.g. widget style
const auto connections = KWayland::Client::ConnectionThread::connections();
for (auto c : connections) {
if (c == m_internalConnection.client) {
continue;
}
emit c->connectionDied();
}
delete m_internalConnection.registry;
delete m_internalConnection.shm;
dispatch();
......
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