diff --git a/src/wayland/autotests/client/test_wayland_windowmanagement.cpp b/src/wayland/autotests/client/test_wayland_windowmanagement.cpp index fbd92bd301..e0269e198b 100644 --- a/src/wayland/autotests/client/test_wayland_windowmanagement.cpp +++ b/src/wayland/autotests/client/test_wayland_windowmanagement.cpp @@ -226,6 +226,7 @@ void TestWindowManagement::cleanup() } if (m_thread) { if (m_connection) { + m_connection->flush(); m_connection->deleteLater(); } m_thread->quit(); @@ -235,6 +236,7 @@ void TestWindowManagement::cleanup() } m_connection = nullptr; + m_display->dispatchEvents(); delete m_windowManagementInterface; m_windowManagementInterface = nullptr;