aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVlad Zagorodniy <[email protected]>2018-12-01 18:33:52 +0200
committerVlad Zagorodniy <[email protected]>2018-12-01 19:06:28 +0200
commit8c70600f1340ce33a0b034137b5524245fae930c (patch)
tree57b2062a2e8ef17cc0dd2678b1ae3881c149eaca
parent3ad9ac7229ff718532971c10076f51bc3f6e23d9 (diff)
[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
-rw-r--r--effects.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/effects.cpp b/effects.cpp
index 61f96e8..4df33fd 100644
--- a/effects.cpp
+++ b/effects.cpp
@@ -287,8 +287,11 @@ void EffectsHandlerImpl::unloadAllEffects()
}
delete effect;
}
- loaded_effects.clear();
+
+ effect_order.clear();
m_effectLoader->clear();
+
+ effectsChanged();
}
void EffectsHandlerImpl::setupAbstractClientConnections(AbstractClient* c)