From 351e96ca751a57681876833866a97d092fa1938d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 26 Mar 2024 17:13:31 +0530 Subject: [PATCH] Ensure temp buffer is destroyed once normal swapping is in place --- glfw/wl_window.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/glfw/wl_window.c b/glfw/wl_window.c index 075b029f5..481e01225 100644 --- a/glfw/wl_window.c +++ b/glfw/wl_window.c @@ -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; - } } }