Commit effe12a0 authored by David Edmundson's avatar David Edmundson Committed by Fushan Wen
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 ca2f02e2
Pipeline #197272 passed with stage
in 6 minutes and 3 seconds
......@@ -37,7 +37,10 @@ SessionTrack::~SessionTrack()
for (auto process : std::as_const(m_processes)) {
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)) {
} 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