diff --git a/autotests/testkwaylanddpms.cpp b/autotests/testkwaylanddpms.cpp --- a/autotests/testkwaylanddpms.cpp +++ b/autotests/testkwaylanddpms.cpp @@ -55,7 +55,7 @@ private: ConnectionThread *m_connection; QThread *m_thread; - Registry m_registry; + Registry *m_registry; KScreen::WaylandTestServer *m_server; }; @@ -89,33 +89,35 @@ m_connection->initConnection(); QVERIFY(connectedSpy.wait(100)); - m_registry.create(m_connection); - QObject::connect(&m_registry, &Registry::interfacesAnnounced, this, + m_registry = new KWayland::Client::Registry; + m_registry->create(m_connection); + QObject::connect(m_registry, &Registry::interfacesAnnounced, this, [this] { - const bool hasDpms = m_registry.hasInterface(Registry::Interface::Dpms); + const bool hasDpms = m_registry->hasInterface(Registry::Interface::Dpms); if (hasDpms) { qDebug() << QStringLiteral("Compositor provides a DpmsManager"); } else { qDebug() << QStringLiteral("Compositor does not provid a DpmsManager"); } emit this->dpmsAnnounced(); }); - m_registry.setup(); + m_registry->setup(); QVERIFY(dpmsSpy.wait(100)); } void TestDpmsClient::cleanupTestCase() { m_thread->exit(); m_thread->wait(); + delete m_registry; delete m_thread; delete m_connection; } void TestDpmsClient::testDpmsConnect() { - QVERIFY(m_registry.isValid()); + QVERIFY(m_registry->isValid()); }