From 4b833d0f4f225c92f1459bfcff0c4255afbd097c Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 2 Feb 2016 22:43:59 +0100 Subject: [PATCH] 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 --- src/scriptengines/qml/plasmoid/containmentinterface.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/scriptengines/qml/plasmoid/containmentinterface.cpp b/src/scriptengines/qml/plasmoid/containmentinterface.cpp index b57cc73fd..2acf68084 100644 --- a/src/scriptengines/qml/plasmoid/containmentinterface.cpp +++ b/src/scriptengines/qml/plasmoid/containmentinterface.cpp @@ -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(); }