From 062f092f3860e80109816760abee329a5dca0d77 Mon Sep 17 00:00:00 2001 From: Xaver Hugl Date: Tue, 28 Mar 2023 13:46:12 +0200 Subject: [PATCH] workspace: prevent dangling pointers in output order list An output can be still enabled but also scheduled for deletion --- src/workspace.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/workspace.cpp b/src/workspace.cpp index 53dde836ef..a557fab8cf 100644 --- a/src/workspace.cpp +++ b/src/workspace.cpp @@ -1325,8 +1325,8 @@ void Workspace::updateOutputs(const QVector &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()); }