Commit d159d05b authored by David Edmundson's avatar David Edmundson Committed by Nate Graham
Browse files

Avoid crash in plasma-session teardown

Whilst iterating through m_proccesses we make them finish. An existing
connect removes them from the vector.

Iterating through a volatile vector is unsafe.

BUG: 454159


(cherry picked from commit 3692ff7c)
parent ac7ff8e2
Pipeline #195431 passed with stage
in 6 minutes and 13 seconds
......@@ -37,7 +37,10 @@ SessionTrack::~SessionTrack()
for (auto process : std::as_const(m_processes)) {
process->terminate();
}
for (auto process : std::as_const(m_processes)) {
// copy before the loop as we remove finished processes from the vector
const QVector<QProcess *> processesCopy = m_processes;
for (auto process : processesCopy) {
if (process->state() == QProcess::Running && !process->waitForFinished(500)) {
process->kill();
} else {
......
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