mirror of
https://github.com/glfw/glfw.git
synced 2024-11-25 22:14:34 +00:00
Fixed crash retrieving the name of some displays.
This commit is contained in:
parent
97ae40496d
commit
cc7f0bd532
@ -55,6 +55,7 @@ guide in the GLFW documentation.
|
||||
- [Cocoa] Bugfix: Full screen windows were never reported as having focus
|
||||
- [Cocoa] Bugfix: A superfluous I/O flag test prevented video modes from being
|
||||
listed for Thunderbolt monitor
|
||||
- [Cocoa] Bugfix: Retrieving the name of some external displays caused segfault
|
||||
- [X11] Added setting of the `WM_CLASS` property to the initial window title
|
||||
- [X11] Bugfix: Removed joystick axis value negation left over from GLFW 2
|
||||
- [X11] Bugfix: The position of hidden windows was ignored by Metacity
|
||||
|
@ -49,9 +49,11 @@ static const char* getDisplayName(CGDirectDisplayID displayID)
|
||||
kIODisplayOnlyPreferredName);
|
||||
names = CFDictionaryGetValue(info, CFSTR(kDisplayProductName));
|
||||
|
||||
if (!CFDictionaryGetValueIfPresent(names, CFSTR("en_US"),
|
||||
if (!names || !CFDictionaryGetValueIfPresent(names, CFSTR("en_US"),
|
||||
(const void**) &value))
|
||||
{
|
||||
_glfwInputError(GLFW_PLATFORM_ERROR, "Failed to retrieve display name");
|
||||
|
||||
CFRelease(info);
|
||||
return strdup("Unknown");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user