From 75b27849f69694ec7f0542cb3e912ec571c7b86d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Wed, 23 Mar 2022 20:08:12 +0100 Subject: [PATCH] Wayland: Fix error paths not closing sending fd Whatever error happens on our end, we should still close the fd so the other end can move on. (cherry picked from commit 990dc4b3888bbaffdc7c3da65ab6c2f8d24285d4) --- README.md | 1 + src/wl_window.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/README.md b/README.md index 4231914f..582500c7 100644 --- a/README.md +++ b/README.md @@ -133,6 +133,7 @@ information on what to include when reporting a bug. `glfwGetClipboardString` - [Wayland] Bugfix: Data source creation error would cause double free at termination - [Wayland] Bugfix: Partial writes of clipboard string would cause beginning to repeat + - [Wayland] Bugfix: Some errors would cause clipboard string transfer to hang ## Contact diff --git a/src/wl_window.c b/src/wl_window.c index d0eef535..497b00dd 100644 --- a/src/wl_window.c +++ b/src/wl_window.c @@ -1733,6 +1733,7 @@ static void dataSourceHandleSend(void* userData, { _glfwInputError(GLFW_PLATFORM_ERROR, "Wayland: Unknown clipboard data source"); + close(fd); return; } @@ -1740,6 +1741,7 @@ static void dataSourceHandleSend(void* userData, { _glfwInputError(GLFW_PLATFORM_ERROR, "Wayland: Copy requested from an invalid string"); + close(fd); return; }