diff --git a/src/wayland/autotests/client/test_wayland_connection_thread.cpp b/src/wayland/autotests/client/test_wayland_connection_thread.cpp index 0a98576c78..7bdda525ec 100644 --- a/src/wayland/autotests/client/test_wayland_connection_thread.cpp +++ b/src/wayland/autotests/client/test_wayland_connection_thread.cpp @@ -226,16 +226,18 @@ void TestWaylandConnectionThread::testConnectFd() QVERIFY(connectedSpy.wait()); // create the Registry - Registry registry; - QSignalSpy announcedSpy(®istry, SIGNAL(interfacesAnnounced())); + QScopedPointer registry(new Registry); + QSignalSpy announcedSpy(registry.data(), SIGNAL(interfacesAnnounced())); QVERIFY(announcedSpy.isValid()); - registry.create(connection); - EventQueue queue; - queue.setup(connection); - registry.setEventQueue(&queue); - registry.setup(); + registry->create(connection); + QScopedPointer queue(new EventQueue); + queue->setup(connection); + registry->setEventQueue(queue.data()); + registry->setup(); QVERIFY(announcedSpy.wait()); + registry.reset(); + queue.reset(); connection->deleteLater(); connectionThread->quit(); connectionThread->wait();