Ensure temp buffer is destroyed once normal swapping is in place

This commit is contained in:
Kovid Goyal 2024-03-26 17:13:31 +05:30
parent 610390ed69
commit 351e96ca75
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

8
glfw/wl_window.c vendored
View file

@ -367,16 +367,16 @@ resizeFramebuffer(_GLFWwindow* window) {
void
_glfwWaylandAfterBufferSwap(_GLFWwindow* window) {
if (window->wl.temp_buffer_used_during_window_creation) {
wl_buffer_destroy(window->wl.temp_buffer_used_during_window_creation);
window->wl.temp_buffer_used_during_window_creation = NULL;
}
if (window->wl.waiting_for_swap_to_commit) {
debug("Waiting for swap to commit: swap has happened, window surface committed\n");
window->wl.waiting_for_swap_to_commit = false;
// this is not really needed, since I think eglSwapBuffers() calls wl_surface_commit()
// but lets be safe. See https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/src/egl/drivers/dri2/platform_wayland.c#L1510
wl_surface_commit(window->wl.surface);
if (window->wl.temp_buffer_used_during_window_creation) {
wl_buffer_destroy(window->wl.temp_buffer_used_during_window_creation);
window->wl.temp_buffer_used_during_window_creation = NULL;
}
}
}