mirror of
https://github.com/glfw/glfw.git
synced 2024-11-23 02:25:10 +00:00
Wayland: Fix multiple copies of single constant
(cherry picked from commit a28adba06a
)
This commit is contained in:
parent
b716ff5b97
commit
d1c0797630
@ -1195,14 +1195,15 @@ int _glfwPlatformInit(void)
|
|||||||
wl_data_device_manager_get_data_device(_glfw.wl.dataDeviceManager,
|
wl_data_device_manager_get_data_device(_glfw.wl.dataDeviceManager,
|
||||||
_glfw.wl.seat);
|
_glfw.wl.seat);
|
||||||
wl_data_device_add_listener(_glfw.wl.dataDevice, &dataDeviceListener, NULL);
|
wl_data_device_add_listener(_glfw.wl.dataDevice, &dataDeviceListener, NULL);
|
||||||
_glfw.wl.clipboardString = malloc(4096);
|
|
||||||
|
_glfw.wl.clipboardSize = 4096;
|
||||||
|
_glfw.wl.clipboardString = calloc(_glfw.wl.clipboardSize, 1);
|
||||||
if (!_glfw.wl.clipboardString)
|
if (!_glfw.wl.clipboardString)
|
||||||
{
|
{
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
"Wayland: Unable to allocate clipboard memory");
|
"Wayland: Unable to allocate clipboard memory");
|
||||||
return GLFW_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
_glfw.wl.clipboardSize = 4096;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return GLFW_TRUE;
|
return GLFW_TRUE;
|
||||||
|
Loading…
Reference in New Issue
Block a user