Fix leak in test

Unregister an interface when we're done with it. This also ensures we
don't have several running in parallel as well.
This commit is contained in:
Aleix Pol 2021-04-22 17:31:26 +02:00
parent c9c1c3ae0d
commit 445289d168

View file

@ -410,7 +410,7 @@ void TestWaylandOutput::testDpms()
using namespace KWayland::Client; using namespace KWayland::Client;
using namespace KWaylandServer; using namespace KWaylandServer;
new DpmsManagerInterface(m_display); DpmsManagerInterface iface(m_display);
// set Dpms on the Output // set Dpms on the Output
QSignalSpy serverDpmsSupportedChangedSpy(m_serverOutput, &OutputInterface::dpmsSupportedChanged); QSignalSpy serverDpmsSupportedChangedSpy(m_serverOutput, &OutputInterface::dpmsSupportedChanged);
@ -505,7 +505,7 @@ void TestWaylandOutput::testDpmsRequestMode()
using namespace KWaylandServer; using namespace KWaylandServer;
// setup code // setup code
new DpmsManagerInterface(m_display); DpmsManagerInterface iface(m_display);
// set Dpms on the Output // set Dpms on the Output
QSignalSpy serverDpmsSupportedChangedSpy(m_serverOutput, &OutputInterface::dpmsSupportedChanged); QSignalSpy serverDpmsSupportedChangedSpy(m_serverOutput, &OutputInterface::dpmsSupportedChanged);