From 611df30ecc1d6608e42d727a2860a2645e7e4469 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Fri, 28 Oct 2016 08:57:22 +0200 Subject: [PATCH] [autotest] fix WaylandConnectionThread::testConnectFd The test destroyed the connection prior to destroying registry and event queue. Thus causing problems. Hopefully this change fixes the segfault on build.kde.org. --- .../client/test_wayland_connection_thread.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) 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();