D17283: [effects] Clean up effect_order in unloadAllEffects

Vlad Zagorodniy <[email protected]>
Newsgroups gmane.comp.kde.devel.kwin
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.