From e5631f0e7b8128f4f6754ec2ff24271dbb889774 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Tue, 19 Dec 2017 15:56:10 +0000 Subject: [PATCH] Scope exported/imported objects to the test Summary: m_imported was parented to the TestForeign class, which lasts for all the tests. This caused an error on teardown. Test Plan: Ran with ASAN. Finally everything passes! Reviewers: #plasma, graesslin Reviewed By: #plasma, graesslin Subscribers: plasma-devel, #frameworks Tags: #frameworks, #plasma_on_wayland Differential Revision: https://phabricator.kde.org/D9407 --- src/wayland/autotests/client/test_xdg_foreign.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/wayland/autotests/client/test_xdg_foreign.cpp b/src/wayland/autotests/client/test_xdg_foreign.cpp index f29812f29c..05032aee4c 100644 --- a/src/wayland/autotests/client/test_xdg_foreign.cpp +++ b/src/wayland/autotests/client/test_xdg_foreign.cpp @@ -210,7 +210,7 @@ void TestForeign::doExport() m_exportedSurfaceInterface = serverSurfaceCreated.first().first().value(); //Export a window - m_exported = m_exporter->exportTopLevel(m_exportedSurface, this); + m_exported = m_exporter->exportTopLevel(m_exportedSurface, m_connection); QVERIFY(m_exported->handle().isEmpty()); QSignalSpy doneSpy(m_exported.data(), &XdgExported::done); QVERIFY(doneSpy.wait()); @@ -220,7 +220,7 @@ void TestForeign::doExport() QVERIFY(transientSpy.isValid()); //Import the just exported window - m_imported = m_importer->importTopLevel(m_exported->handle(), this); + m_imported = m_importer->importTopLevel(m_exported->handle(), m_connection); QVERIFY(m_imported->isValid()); QSignalSpy childSurfaceInterfaceCreated(m_compositorInterface, SIGNAL(surfaceCreated(KWayland::Server::SurfaceInterface*))); @@ -327,7 +327,7 @@ void TestForeign::testExportTwoTimes() doExport(); //Export second window - KWayland::Client::XdgExported *exported2 = m_exporter->exportTopLevel(m_exportedSurface, this); + KWayland::Client::XdgExported *exported2 = m_exporter->exportTopLevel(m_exportedSurface, m_connection); QVERIFY(exported2->handle().isEmpty()); QSignalSpy doneSpy(exported2, &XdgExported::done); QVERIFY(doneSpy.wait()); @@ -337,7 +337,7 @@ void TestForeign::testExportTwoTimes() QVERIFY(transientSpy.isValid()); //Import the just exported window - KWayland::Client::XdgImported *imported2 = m_importer->importTopLevel(exported2->handle(), this); + KWayland::Client::XdgImported *imported2 = m_importer->importTopLevel(exported2->handle(), m_connection); QVERIFY(imported2->isValid()); //create a second child surface @@ -370,7 +370,7 @@ void TestForeign::testImportTwoTimes() QVERIFY(transientSpy.isValid()); //Import another time the exported window - KWayland::Client::XdgImported *imported2 = m_importer->importTopLevel(m_exported->handle(), this); + KWayland::Client::XdgImported *imported2 = m_importer->importTopLevel(m_exported->handle(), m_connection); QVERIFY(imported2->isValid()); //create a second child surface