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.
This commit is contained in:
Tom Englund
2025-07-08 18:55:46 +02:00
committed by GitHub
parent 8f948827a6
commit 2f34ef141b

View File

@@ -128,6 +128,13 @@ CWLSurfaceResource::CWLSurfaceResource(SP<CWlSurface> 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;
}