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 990dc4b388)
This commit is contained in:
Camilla Löwy 2022-03-23 20:08:12 +01:00
parent f51ec79951
commit 75b27849f6
2 changed files with 3 additions and 0 deletions

View File

@ -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

View File

@ -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;
}