mirror of
https://github.com/glfw/glfw.git
synced 2024-11-29 15:44:35 +00:00
Added allocation failure check.
This commit is contained in:
parent
ea664c8a39
commit
c87829ea61
@ -124,6 +124,11 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count)
|
|||||||
size = 4;
|
size = 4;
|
||||||
|
|
||||||
monitors = (_GLFWmonitor**) realloc(monitors, sizeof(_GLFWmonitor*) * size);
|
monitors = (_GLFWmonitor**) realloc(monitors, sizeof(_GLFWmonitor*) * size);
|
||||||
|
if (!monitors)
|
||||||
|
{
|
||||||
|
// TODO: wat
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
monitors[found] = _glfwCreateMonitor(name,
|
monitors[found] = _glfwCreateMonitor(name,
|
||||||
|
Loading…
Reference in New Issue
Block a user