Fix segfault on DISP_CHANGE_RESTART

Fixes #647.
This commit is contained in:
Camilla Berglund 2015-12-06 14:55:57 +01:00
parent b3d0bd6081
commit 5668b64839
2 changed files with 10 additions and 0 deletions

View File

@ -75,6 +75,8 @@ used by the tests and examples and are not required to build the library.
- Relaxed rules for native access header macros
- Removed dependency on external OpenGL or OpenGL ES headers
- [Win32] Added support for Windows 8.1 per-monitor DPI
- [Win32] Bugfix: Window creation would segfault if video mode setting required
the system to be restarted
- [Cocoa] Removed support for OS X 10.6
- [Cocoa] Bugfix: Full screen windows on secondary monitors were mispositioned
- [X11] Bugfix: Monitor connection and disconnection events were not reported

View File

@ -278,6 +278,14 @@ GLFWvidmode* _glfwPlatformGetVideoModes(_GLFWmonitor* monitor, int* count)
result[*count - 1] = mode;
}
if (!*count)
{
// HACK: Report the current mode if no valid modes were found
result = calloc(1, sizeof(GLFWvidmode));
_glfwPlatformVideoMode(monitor, result);
*count = 1;
}
return result;
}