From 5c23071a81ab9cfe3185ffc7028c7cc31e847320 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Mon, 10 Mar 2014 18:41:52 +0100 Subject: [PATCH] Fixed leak of display name. --- README.md | 1 + src/cocoa_monitor.m | 2 ++ 2 files changed, 3 insertions(+) diff --git a/README.md b/README.md index 64d5a114..54207901 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,7 @@ The following dependencies are needed by the examples and test programs: recorders to fail - [Cocoa] Bugfix: Some Core Foundation objects were leaked during joystick enumeration + - [Cocoa] Bugfix: One copy of each display name string was leaked - [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 ab401ca1..5677f744 100644 --- a/src/cocoa_monitor.m +++ b/src/cocoa_monitor.m @@ -308,6 +308,8 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count) monitors[found] = _glfwAllocMonitor(name, size.width, size.height); monitors[found]->ns.displayID = displays[i]; + free(name); + for (j = 0; j < [screens count]; j++) { NSScreen* screen = [screens objectAtIndex:j];