From bf0adc2c7071485be1d5daf8aa1a0c88ef970281 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Tue, 25 Mar 2014 19:37:25 +0100 Subject: [PATCH] Fixed crash on monitor disconnection. --- README.md | 2 ++ src/cocoa_monitor.m | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5ea4495f..c1375252 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,8 @@ The following dependencies are needed by the examples and test programs: - [Cocoa] Bugfix: Some Core Foundation objects were leaked during joystick enumeration - [Cocoa] Bugfix: One copy of each display name string was leaked + - [Cocoa] Bugfix: Monitor enumeration caused a segfault if no `NSScreen` was + found for a given `CGDisplay` - [Win32] Enabled generation of pkg-config file for MinGW - [Win32] Bugfix: Failure to load winmm or its functions was not reported to the error callback diff --git a/src/cocoa_monitor.m b/src/cocoa_monitor.m index ebeb25c0..ff908ae2 100644 --- a/src/cocoa_monitor.m +++ b/src/cocoa_monitor.m @@ -286,8 +286,7 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count) else { _glfwInputError(GLFW_PLATFORM_ERROR, - "Cocoa: Failed to find NSScreen for CGDisplay %s", - monitors[found]->name); + "Cocoa: Failed to find NSScreen for CGDisplay"); _glfwFreeMonitor(monitors[found]); monitors[found] = NULL;