mirror of
https://github.com/glfw/glfw.git
synced 2026-09-19 15:25:50 +00:00
Wayland: Fix glfwPostEmptyEvent leaking a proxy
The client-side proxy of the callback from each call to wl_display_sync was never destroyed. Fixes #2836
This commit is contained in:
+13
-1
@@ -199,6 +199,16 @@ static struct wl_buffer* createShmBuffer(const GLFWimage* image)
|
||||
return buffer;
|
||||
}
|
||||
|
||||
static void callbackHandleDone(void* userData, struct wl_callback* callback, uint32_t data)
|
||||
{
|
||||
wl_callback_destroy(callback);
|
||||
}
|
||||
|
||||
static const struct wl_callback_listener noopCallbackListener =
|
||||
{
|
||||
callbackHandleDone
|
||||
};
|
||||
|
||||
static void createFallbackEdge(_GLFWwindow* window,
|
||||
_GLFWfallbackEdgeWayland* edge,
|
||||
struct wl_surface* parent,
|
||||
@@ -2930,7 +2940,9 @@ void _glfwWaitEventsTimeoutWayland(double timeout)
|
||||
|
||||
void _glfwPostEmptyEventWayland(void)
|
||||
{
|
||||
wl_display_sync(_glfw.wl.display);
|
||||
struct wl_callback* callback = wl_display_sync(_glfw.wl.display);
|
||||
wl_callback_add_listener(callback, &noopCallbackListener, NULL);
|
||||
|
||||
flushDisplay();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user