Commit d67ce1e8 authored by David Edmundson's avatar David Edmundson
Browse files

Fix ASAN warning on TestXdgForeign

Summary:
Internally XdgForeign has some delete laters

If we clean up the connection immediately we delete them after we kill
the connection resulting in an error.

Kwin isn't going to tear down the connection in response to a resource
unbinding so we can just fix the test.

Test Plan:
Compiled with ASAN
Got further

Reviewers: #plasma, graesslin

Reviewed By: #plasma, graesslin

Subscribers: plasma-devel, #frameworks

Tags: #frameworks, #plasma

Differential Revision: https://phabricator.kde.org/D9406
parent 9251e894
......@@ -165,20 +165,9 @@ void TestForeign::cleanup()
variable = nullptr; \
}
//some tests delete it beforehand
if (m_exportedSurfaceInterface) {
QSignalSpy exportedSurfaceDestroyedSpy(m_exportedSurfaceInterface.data(), &QObject::destroyed);
QVERIFY(exportedSurfaceDestroyedSpy.isValid());
CLEANUP(m_exportedSurface)
exportedSurfaceDestroyedSpy.wait();
}
CLEANUP(m_exportedSurfaceInterface)
CLEANUP(m_childSurfaceInterface)
if (m_childSurfaceInterface) {
QSignalSpy childSurfaceDestroyedSpy(m_childSurfaceInterface.data(), &QObject::destroyed);
QVERIFY(childSurfaceDestroyedSpy.isValid());
CLEANUP(m_childSurface)
childSurfaceDestroyedSpy.wait();
}
CLEANUP(m_compositor)
......@@ -197,7 +186,16 @@ void TestForeign::cleanup()
}
CLEANUP(m_compositorInterface)
CLEANUP(m_foreignInterface)
CLEANUP(m_display)
//internally there are some deleteLaters on exported interfaces
//we want them processed before we delete the connection
if (m_display) {
QSignalSpy destroyedSpy(m_display, &QObject::destroyed);
m_display->deleteLater();
m_display = nullptr;
destroyedSpy.wait();
}
#undef CLEANUP
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment