diff --git a/autotests/wayland/kwin_wayland_test.cpp b/autotests/wayland/kwin_wayland_test.cpp index ba37dfa6a9..ad651bee9e 100644 --- a/autotests/wayland/kwin_wayland_test.cpp +++ b/autotests/wayland/kwin_wayland_test.cpp @@ -68,7 +68,9 @@ WaylandTestApplication::~WaylandTestApplication() } if (m_xwaylandProcess) { m_xwaylandProcess->terminate(); - m_xwaylandProcess->waitForFinished(); + while (m_xwaylandProcess->state() != QProcess::NotRunning) { + processEvents(QEventLoop::WaitForMoreEvents); + } waylandServer()->destroyXWaylandConnection(); } waylandServer()->destroyInternalConnection(); diff --git a/main_wayland.cpp b/main_wayland.cpp index 21aeebb6a1..10d14d03f7 100644 --- a/main_wayland.cpp +++ b/main_wayland.cpp @@ -92,7 +92,9 @@ ApplicationWayland::~ApplicationWayland() } if (m_xwaylandProcess) { m_xwaylandProcess->terminate(); - m_xwaylandProcess->waitForFinished(); + while (m_xwaylandProcess->state() != QProcess::NotRunning) { + processEvents(QEventLoop::WaitForMoreEvents); + } waylandServer()->destroyXWaylandConnection(); } waylandServer()->destroyInternalConnection();