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.
This commit is contained in:
Simon Ser 2022-12-06 20:14:44 +01:00
parent d72b4409ce
commit 378f471d29

View file

@ -116,6 +116,9 @@ void destroy_wl_buffer(struct wlr_wl_buffer *buffer) {
wl_list_remove(&buffer->buffer_destroy.link); wl_list_remove(&buffer->buffer_destroy.link);
wl_list_remove(&buffer->link); wl_list_remove(&buffer->link);
wl_buffer_destroy(buffer->wl_buffer); wl_buffer_destroy(buffer->wl_buffer);
if (!buffer->released) {
wlr_buffer_unlock(buffer->buffer);
}
free(buffer); free(buffer);
} }