Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 8c70600f authored by Vlad Zahorodnii's avatar Vlad Zahorodnii

[effects] Clean up effect_order in unloadAllEffects

Summary:
EffectsHandlerImpl::unloadAllEffects can be very useful when writing
tests, e.g.:

    auto effectsImpl = qobect_cast<EffectsHandlerImpl *>(effects);
    QVERIFY(effectsImpl);

    effectsImpl->unloadAllEffects();
    QVERIFY(effectsImpl->loadEffect(QStringLiteral("kwin5_effect_foobar")));

but because unloadAllEffects doesn't clean up effect_order, the old
effects can be re-added back into loaded_effects when a new effect is
loaded. Such behavior can result in a segfault.

Test Plan: Existing tests pass.

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D17283
parent 3ad9ac72
......@@ -287,8 +287,11 @@ void EffectsHandlerImpl::unloadAllEffects()
}
delete effect;
}
loaded_effects.clear();
effect_order.clear();
m_effectLoader->clear();
effectsChanged();
}
void EffectsHandlerImpl::setupAbstractClientConnections(AbstractClient* c)
......
Markdown is supported
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