[kwin] Fix crash in tear-down of EffectsHandlerImpl

Adding a simplified logic to unload all effects directly in the
dtor. Looks like Qt didn't like our double traversal over the list
any more and was causing double deletions.
This commit is contained in:
Martin Gräßlin 2013-11-13 10:03:58 +01:00
parent 6a1cadc0a7
commit 0ad6811684

View file

@ -261,8 +261,21 @@ EffectsHandlerImpl::~EffectsHandlerImpl()
{
if (keyboard_grab_effect != NULL)
ungrabKeyboard();
for (const EffectPair & ep : loaded_effects)
unloadEffect(ep.first);
setActiveFullScreenEffect(nullptr);
for (auto it = loaded_effects.begin(); it != loaded_effects.end(); ++it) {
const QString &name = (*it).first;
Effect *effect = (*it).second;
stopMouseInterception(effect);
// remove support properties for the effect
const QList<QByteArray> properties = m_propertiesForEffects.keys();
for (const QByteArray &property : properties) {
removeSupportProperty(property, effect);
}
delete effect;
if (effect_libraries.contains(name)) {
effect_libraries[ name ]->unload();
}
}
}
void EffectsHandlerImpl::setupClientConnections(Client* c)