diff --git a/autotests/integration/effects/scripted_effects_test.cpp b/autotests/integration/effects/scripted_effects_test.cpp --- a/autotests/integration/effects/scripted_effects_test.cpp +++ b/autotests/integration/effects/scripted_effects_test.cpp @@ -184,13 +184,11 @@ void ScriptedEffectsTest::cleanup() { + auto effectsImpl = static_cast(effects); + effectsImpl->unloadAllEffects(); + QVERIFY(effectsImpl->loadedEffects().isEmpty()); + Test::destroyWaylandConnection(); - auto *e = static_cast(effects); - while (!e->loadedEffects().isEmpty()) { - const QString effect = e->loadedEffects().first(); - e->unloadEffect(effect); - QVERIFY(!e->isEffectLoaded(effect)); - } KWin::VirtualDesktopManager::self()->setCurrent(1); } diff --git a/autotests/integration/effects/wobbly_shade_test.cpp b/autotests/integration/effects/wobbly_shade_test.cpp --- a/autotests/integration/effects/wobbly_shade_test.cpp +++ b/autotests/integration/effects/wobbly_shade_test.cpp @@ -95,13 +95,11 @@ void WobblyWindowsShadeTest::cleanup() { + auto effectsImpl = static_cast(effects); + effectsImpl->unloadAllEffects(); + QVERIFY(effectsImpl->loadedEffects().isEmpty()); + Test::destroyWaylandConnection(); - EffectsHandlerImpl *e = static_cast(effects); - while (!e->loadedEffects().isEmpty()) { - const QString effect = e->loadedEffects().first(); - e->unloadEffect(effect); - QVERIFY(!e->isEffectLoaded(effect)); - } } struct XcbConnectionDeleter