[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.
This commit is contained in:
Martin Gräßlin 2016-10-28 08:57:22 +02:00
parent 3f0c879713
commit 611df30ecc

View file

@ -226,16 +226,18 @@ void TestWaylandConnectionThread::testConnectFd()
QVERIFY(connectedSpy.wait());
// create the Registry
Registry registry;
QSignalSpy announcedSpy(&registry, SIGNAL(interfacesAnnounced()));
QScopedPointer<Registry> 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<EventQueue> 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();