Skip to content

Commit

Permalink
core/compositor: fix too early buffer release (#8966)
Browse files Browse the repository at this point in the history
  • Loading branch information
UjinT34 authored Jan 6, 2025
1 parent 602d6b7 commit 6a90b50
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/protocols/core/Compositor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,7 @@ void CWLSurfaceResource::commitPendingState() {
pending.damage.clear();
pending.bufferDamage.clear();
pending.newBuffer = false;
dropPendingBuffer(); // at this point current.buffer holds the same SP and we don't use pending anymore

events.roleCommit.emit();

Expand All @@ -448,10 +449,9 @@ void CWLSurfaceResource::commitPendingState() {

// release the buffer if it's synchronous as update() has done everything thats needed
// so we can let the app know we're done.
if (current.buffer->buffer->isSynchronous()) {
dropCurrentBuffer();
dropPendingBuffer(); // pending atm is just a copied ref of the current, drop it too to send a release
}
// Some clients aren't ready to receive a release this early. Should be fine to release it on the next commitPendingState.
// if (current.buffer->buffer->isSynchronous())
// dropCurrentBuffer();
}

// TODO: we should _accumulate_ and not replace above if sync
Expand Down

0 comments on commit 6a90b50

Please sign in to comment.