From 2f34ef141b0728857d2a6f777c608dfe4c207733 Mon Sep 17 00:00:00 2001 From: Tom Englund Date: Tue, 8 Jul 2025 18:55:46 +0200 Subject: [PATCH] compositor: fix race to finish on null buffer (#10970) if a null buffer is commited and a pending state is awaiting, drop the pending state so we dont end up in race to finish brokeness. --- src/protocols/core/Compositor.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/protocols/core/Compositor.cpp b/src/protocols/core/Compositor.cpp index 9f3a5407..10245982 100644 --- a/src/protocols/core/Compositor.cpp +++ b/src/protocols/core/Compositor.cpp @@ -128,6 +128,13 @@ CWLSurfaceResource::CWLSurfaceResource(SP resource_) : m_resource(re (!m_pending.buffer && !m_pending.texture) // null buffer attached ) { commitState(m_pending); + + if (!m_pending.buffer && !m_pending.texture) { + // null buffer attached, remove any pending states. + while (!m_pendingStates.empty()) { + m_pendingStates.pop(); + } + } m_pending.reset(); return; }