Commit 5e548060 authored by David Edmundson's avatar David Edmundson
Browse files

Clear cgroup PIDS -> process object cache whenever Processes update

Previously we wiped the cache whenever CGroupDataModel is about to call
updateAllProcesses. With the shared backend we need to clear it whenever
any part updates.

BUG: 435532
parent 52bcf43c
......@@ -125,6 +125,13 @@ CGroupDataModel::CGroupDataModel(const QString &root, QObject *parent)
d->m_updateTimer->setInterval(2000);
d->m_updateTimer->start();
// updateAllProcesses will delete processes that no longer exist, a method that
// can be called by any user of the shared Processes
// so clear out our cache of cgroup -> process whenever anything gets removed
connect(d->m_processes.data(), &Processes::beginRemoveProcess, this, [this]() {
d->m_processMap.clear();
});
setRoot(root);
}
......@@ -392,11 +399,6 @@ void CGroupDataModel::update()
d->m_oldGroups = d->m_cgroupMap;
// updateAllProcesses will delete processes that no longer exist, so clear
// out our cache of the processes before that happens so we have no dangling
// processes.
d->m_processMap.clear();
// In an ideal world we would only the relevant process
// but Ksysguard::Processes doesn't handle that very well
d->m_processes->updateAllProcesses();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment