mirror of
https://github.com/glfw/glfw.git
synced 2026-09-18 22:55:46 +00:00
Assume that malloc works.
This commit is contained in:
+1
-12
@@ -244,21 +244,10 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count)
|
||||
CGGetActiveDisplayList(0, NULL, &monitorCount);
|
||||
|
||||
displays = (CGDirectDisplayID*) calloc(monitorCount, sizeof(CGDirectDisplayID));
|
||||
if (!displays)
|
||||
{
|
||||
_glfwInputError(GLFW_OUT_OF_MEMORY, NULL);
|
||||
return NULL;
|
||||
}
|
||||
monitors = (_GLFWmonitor**) calloc(monitorCount, sizeof(_GLFWmonitor*));
|
||||
|
||||
CGGetActiveDisplayList(monitorCount, displays, &monitorCount);
|
||||
|
||||
monitors = (_GLFWmonitor**) calloc(monitorCount, sizeof(_GLFWmonitor*));
|
||||
if (!monitors)
|
||||
{
|
||||
_glfwInputError(GLFW_OUT_OF_MEMORY, NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (i = 0; i < monitorCount; i++)
|
||||
{
|
||||
const CGSize size = CGDisplayScreenSize(displays[i]);
|
||||
|
||||
Reference in New Issue
Block a user