diff --git a/dataengine.cpp b/dataengine.cpp index 1e5eea040..c2488ec67 100644 --- a/dataengine.cpp +++ b/dataengine.cpp @@ -341,9 +341,11 @@ void DataEngine::removeAllSources() QMutableHashIterator it(d->sources); while (it.hasNext()) { it.next(); - emit sourceRemoved(it.key()); - delete it.value(); + const QString source = it.key(); + Plasma::DataContainer *s = it.value(); it.remove(); + emit sourceRemoved(source); + delete s; } }