Wayland: Simplify clipboard string allocation

(cherry picked from commit 4651165272)
This commit is contained in:
Camilla Löwy
2022-03-24 18:02:48 +01:00
parent a31c648127
commit 857fae4920
3 changed files with 25 additions and 45 deletions
-10
View File
@@ -1241,15 +1241,6 @@ int _glfwPlatformInit(void)
wl_data_device_manager_get_data_device(_glfw.wl.dataDeviceManager,
_glfw.wl.seat);
wl_data_device_add_listener(_glfw.wl.dataDevice, &dataDeviceListener, NULL);
_glfw.wl.clipboardSize = 4096;
_glfw.wl.clipboardString = calloc(_glfw.wl.clipboardSize, 1);
if (!_glfw.wl.clipboardString)
{
_glfwInputError(GLFW_OUT_OF_MEMORY,
"Wayland: Failed to allocate clipboard memory");
return GLFW_FALSE;
}
}
return GLFW_TRUE;
@@ -1346,7 +1337,6 @@ void _glfwPlatformTerminate(void)
close(_glfw.wl.cursorTimerfd);
free(_glfw.wl.clipboardString);
free(_glfw.wl.clipboardSendString);
}
const char* _glfwPlatformGetVersionString(void)