workspace: prevent dangling pointers in output order list

An output can be still enabled but also scheduled for deletion
This commit is contained in:
Xaver Hugl 2023-03-28 13:46:12 +02:00
parent c51824b535
commit 062f092f38

View file

@ -1325,8 +1325,8 @@ void Workspace::updateOutputs(const QVector<Output *> &outputOrder)
m_outputOrder.push_back(output);
}
}
m_outputOrder.erase(std::remove_if(m_outputOrder.begin(), m_outputOrder.end(), [](Output *output) {
return !output->isEnabled();
m_outputOrder.erase(std::remove_if(m_outputOrder.begin(), m_outputOrder.end(), [this](Output *output) {
return !m_outputs.contains(output);
}),
m_outputOrder.end());
}