Added allocation failure check.

This commit is contained in:
Camilla Berglund 2012-09-12 20:54:45 +02:00
parent ea664c8a39
commit c87829ea61

View File

@ -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,