Fixed crash retrieving the name of some displays.

master
Camilla Berglund ago%!(EXTRA string=12 years)
parent 97ae40496d
commit cc7f0bd532
  1. 1
      README.md
  2. 6
      src/cocoa_monitor.m

@ -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"),
(const void**) &value))
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…
Cancel
Save