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
This commit is contained in:
parent
9251e894e4
commit
d67ce1e86c
1 changed files with 12 additions and 14 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue