From ee7da425cefcd5cbe480335a144eee6218207dd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 3 Nov 2016 11:00:08 +0100 Subject: [PATCH] Unpolish QStyle on QApp prior to destroying internal Wayland connection Summary: The QStyle might interact with our internal Wayland connection. If the cleanup happens after destroying our internal Wayland connection KWin will crash at tear-down. With this change the QStyle can perform cleanup already prior to the deconstruction of the Wayland connection. CCBUG: 372001 Reviewers: #kwin, #plasma_on_wayland Subscribers: plasma-devel, kwin Tags: #plasma_on_wayland, #kwin Differential Revision: https://phabricator.kde.org/D3241 --- autotests/integration/kwin_wayland_test.cpp | 4 ++++ main_wayland.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/autotests/integration/kwin_wayland_test.cpp b/autotests/integration/kwin_wayland_test.cpp index ccdd078d6c..d2aa6d05db 100644 --- a/autotests/integration/kwin_wayland_test.cpp +++ b/autotests/integration/kwin_wayland_test.cpp @@ -30,6 +30,7 @@ along with this program. If not, see . #include #include #include +#include #include #include @@ -80,6 +81,9 @@ WaylandTestApplication::~WaylandTestApplication() } waylandServer()->destroyXWaylandConnection(); } + if (QStyle *s = style()) { + s->unpolish(this); + } waylandServer()->terminateClientConnections(); destroyCompositor(); } diff --git a/main_wayland.cpp b/main_wayland.cpp index 802b10fa6a..364f4ca725 100644 --- a/main_wayland.cpp +++ b/main_wayland.cpp @@ -45,6 +45,7 @@ along with this program. If not, see . #include #include #include +#include #include #include #include @@ -114,6 +115,9 @@ ApplicationWayland::~ApplicationWayland() } waylandServer()->destroyXWaylandConnection(); } + if (QStyle *s = style()) { + s->unpolish(this); + } waylandServer()->terminateClientConnections(); destroyCompositor(); }