aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2022-12-06 20:14:44 +0100
committerSimon Ser <contact@emersion.fr>2022-12-06 20:14:44 +0100
commit378f471d292ead8e5286d517a811c8726aa07959 (patch)
treeb4646d79e4aaf73ada96822ab93cdbc31ba8f2dd
parentd72b4409ce05e5604685fb8468068c8057315b2d (diff)
backend/wayland: ensure buffers are released on shutdown
destroy_wl_buffer() is called from backend_destroy(). We need to ensure the wlr_buffer is unlocked when we're waiting for a wl_buffer.release event from the parent compositor.
-rw-r--r--backend/wayland/output.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/backend/wayland/output.c b/backend/wayland/output.c
index ca16cbf5..1e96f03b 100644
--- a/backend/wayland/output.c
+++ b/backend/wayland/output.c
@@ -116,6 +116,9 @@ void destroy_wl_buffer(struct wlr_wl_buffer *buffer) {
wl_list_remove(&buffer->buffer_destroy.link);
wl_list_remove(&buffer->link);
wl_buffer_destroy(buffer->wl_buffer);
+ if (!buffer->released) {
+ wlr_buffer_unlock(buffer->buffer);
+ }
free(buffer);
}