more explicit removal from m_appletInterfaces

removal should happen in handler of
Containment::AppletDeleted, but make extra sure to remove it
in case removal happens too late and an access happens
in the meantime
make extra sure dead objects aren't in m_appletInterfaces

BUG:358551
This commit is contained in:
Marco Martin 2016-02-02 22:43:59 +01:00
parent 4e03525b47
commit 4b833d0f4f

View File

@ -765,6 +765,10 @@ void ContainmentInterface::appletAddedForward(Plasma::Applet *applet)
}
m_appletInterfaces << appletGraphicObject;
connect(appletGraphicObject, &QObject::destroyed, this,
[this](QObject *obj) {
m_appletInterfaces.removeAll(obj);
});
emit appletAdded(appletGraphicObject, appletGraphicObject->m_positionBeforeRemoval.x(), appletGraphicObject->m_positionBeforeRemoval.y());
emit appletsChanged();
}