Wayland: Simplify clipboard string allocation

This commit is contained in:
Camilla Löwy
2022-03-24 18:02:48 +01:00
parent 8d87be1268
commit 4651165272
3 changed files with 25 additions and 45 deletions

View File

@@ -1413,15 +1413,6 @@ int _glfwInitWayland(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 = _glfw_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;
@@ -1513,6 +1504,5 @@ void _glfwTerminateWayland(void)
close(_glfw.wl.cursorTimerfd);
_glfw_free(_glfw.wl.clipboardString);
_glfw_free(_glfw.wl.clipboardSendString);
}