diff --git a/src/wayland/autotests/client/test_wayland_windowmanagement.cpp b/src/wayland/autotests/client/test_wayland_windowmanagement.cpp index 85316298ed..9f259cabfe 100644 --- a/src/wayland/autotests/client/test_wayland_windowmanagement.cpp +++ b/src/wayland/autotests/client/test_wayland_windowmanagement.cpp @@ -149,9 +149,6 @@ void TestWindowManagement::init() QVERIFY(serverSurfaceCreated.wait()); m_surfaceInterface = serverSurfaceCreated.first().first().value(); QVERIFY(m_surfaceInterface); - - m_surface = m_compositor->createSurface(this); - QVERIFY(m_surface); } void TestWindowManagement::testWindowTitle() @@ -192,6 +189,10 @@ void TestWindowManagement::cleanup() delete m_surfaceInterface; m_surfaceInterface = nullptr; + if (m_surface) { + delete m_surface; + m_surface = nullptr; + } if (m_compositor) { delete m_compositor; m_compositor = nullptr;