From 8f2336f02cc7987e7fa9a36c22c2af1046d920b9 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Thu, 29 May 2014 11:28:22 +0200 Subject: [PATCH] Fixed release of get rule objects. Partial revert of b4c03b992c. Fixes #262. --- src/iokit_joystick.m | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/iokit_joystick.m b/src/iokit_joystick.m index bce9838f..dd2ff492 100644 --- a/src/iokit_joystick.m +++ b/src/iokit_joystick.m @@ -342,12 +342,9 @@ void _glfwInitJoysticks(void) if (usagePage != kHIDPage_GenericDesktop) { // This device is not relevant to GLFW - CFRelease(valueRef); CFRelease(propsRef); continue; } - - CFRelease(valueRef); } valueRef = CFDictionaryGetValue(propsRef, CFSTR(kIOHIDPrimaryUsageKey)); @@ -360,12 +357,9 @@ void _glfwInitJoysticks(void) usage != kHIDUsage_GD_MultiAxisController)) { // This device is not relevant to GLFW - CFRelease(valueRef); CFRelease(propsRef); continue; } - - CFRelease(valueRef); } _GLFWjoystickIOKit* joystick = _glfw.iokit_js + joy; @@ -379,7 +373,6 @@ void _glfwInitJoysticks(void) if (kIOReturnSuccess != result) { - CFRelease(valueRef); CFRelease(propsRef); return; } @@ -391,7 +384,6 @@ void _glfwInitJoysticks(void) if (plugInResult != S_OK) { - CFRelease(valueRef); CFRelease(propsRef); return; } @@ -412,7 +404,6 @@ void _glfwInitJoysticks(void) joystick->name, sizeof(joystick->name), kCFStringEncodingUTF8); - CFRelease(valueRef); } joystick->axisElements = CFArrayCreateMutable(NULL, 0, NULL); @@ -427,8 +418,8 @@ void _glfwInitJoysticks(void) range, getElementsCFArrayHandler, (void*) joystick); - CFRelease(valueRef); } + CFRelease(propsRef); joystick->axes = calloc(CFArrayGetCount(joystick->axisElements),