From c6e02c09ff0f8ad89eb893577be641c4ae3e14df Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Thu, 29 May 2014 13:19:08 +0200 Subject: [PATCH] Fixed leaks of joystick mutable arrays. --- README.md | 2 +- src/iokit_joystick.m | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 798509ae..c912c625 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ The following dependencies are needed by the examples and test programs: - [Cocoa] Bugfix: Using a 1x1 cursor for hidden mode caused some screen recorders to fail - [Cocoa] Bugfix: Some Core Foundation objects were leaked during joystick - enumeration + enumeration and termination - [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` diff --git a/src/iokit_joystick.m b/src/iokit_joystick.m index dd2ff492..a09fbcf3 100644 --- a/src/iokit_joystick.m +++ b/src/iokit_joystick.m @@ -443,6 +443,13 @@ void _glfwTerminateJoysticks(void) { _GLFWjoystickIOKit* joystick = &_glfw.iokit_js[i]; removeJoystick(joystick); + + if (joystick->axisElements) + CFRelease(joystick->axisElements); + if (joystick->buttonElements) + CFRelease(joystick->buttonElements); + if (joystick->hatElements) + CFRelease(joystick->hatElements); } }