Discussion:
D17283: [effects] Clean up effect_order in unloadAllEffects
Vlad Zagorodniy
2018-12-01 16:59:47 UTC
Permalink
zzag created this revision.
zzag added a reviewer: KWin.
Herald added a project: KWin.
Herald added a subscriber: kwin.
zzag requested review of this revision.

REVISION 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.

REPOSITORY
R108 KWin

BRANCH
delete-dangling-points-from-effects-chain

REVISION DETAIL
https://phabricator.kde.org/D17283

AFFECTED FILES
effects.cpp

To: zzag, #kwin
Cc: kwin, mkulinski, ragreen, jackyalcine, Pitel, iodelay, bwowk, ZrenBot, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart
Martin Flöser
2018-12-01 17:05:23 UTC
Permalink
graesslin accepted this revision.
This revision is now accepted and ready to land.

REPOSITORY
R108 KWin

BRANCH
delete-dangling-points-from-effects-chain

REVISION DETAIL
https://phabricator.kde.org/D17283

To: zzag, #kwin, graesslin
Cc: kwin, mkulinski, ragreen, jackyalcine, Pitel, iodelay, bwowk, ZrenBot, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart
Vlad Zagorodniy
2018-12-01 17:06:36 UTC
Permalink
This revision was automatically updated to reflect the committed changes.
Closed by commit R108:8c70600f1340: [effects] Clean up effect_order in unloadAllEffects (authored by zzag).

REPOSITORY
R108 KWin

CHANGES SINCE LAST UPDATE
https://phabricator.kde.org/D17283?vs=46629&id=46630

REVISION DETAIL
https://phabricator.kde.org/D17283

AFFECTED FILES
effects.cpp

To: zzag, #kwin, graesslin
Cc: kwin, mkulinski, ragreen, jackyalcine, Pitel, iodelay, bwowk, ZrenBot, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart
Loading...