mirror of
https://github.com/glfw/glfw.git
synced 2024-11-26 22:34:35 +00:00
Fixed release of get rule objects.
Partial revert of b4c03b992c
.
Fixes #262.
This commit is contained in:
parent
0ffe934a3e
commit
8f2336f02c
@ -342,12 +342,9 @@ void _glfwInitJoysticks(void)
|
|||||||
if (usagePage != kHIDPage_GenericDesktop)
|
if (usagePage != kHIDPage_GenericDesktop)
|
||||||
{
|
{
|
||||||
// This device is not relevant to GLFW
|
// This device is not relevant to GLFW
|
||||||
CFRelease(valueRef);
|
|
||||||
CFRelease(propsRef);
|
CFRelease(propsRef);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
CFRelease(valueRef);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
valueRef = CFDictionaryGetValue(propsRef, CFSTR(kIOHIDPrimaryUsageKey));
|
valueRef = CFDictionaryGetValue(propsRef, CFSTR(kIOHIDPrimaryUsageKey));
|
||||||
@ -360,12 +357,9 @@ void _glfwInitJoysticks(void)
|
|||||||
usage != kHIDUsage_GD_MultiAxisController))
|
usage != kHIDUsage_GD_MultiAxisController))
|
||||||
{
|
{
|
||||||
// This device is not relevant to GLFW
|
// This device is not relevant to GLFW
|
||||||
CFRelease(valueRef);
|
|
||||||
CFRelease(propsRef);
|
CFRelease(propsRef);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
CFRelease(valueRef);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_GLFWjoystickIOKit* joystick = _glfw.iokit_js + joy;
|
_GLFWjoystickIOKit* joystick = _glfw.iokit_js + joy;
|
||||||
@ -379,7 +373,6 @@ void _glfwInitJoysticks(void)
|
|||||||
|
|
||||||
if (kIOReturnSuccess != result)
|
if (kIOReturnSuccess != result)
|
||||||
{
|
{
|
||||||
CFRelease(valueRef);
|
|
||||||
CFRelease(propsRef);
|
CFRelease(propsRef);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -391,7 +384,6 @@ void _glfwInitJoysticks(void)
|
|||||||
|
|
||||||
if (plugInResult != S_OK)
|
if (plugInResult != S_OK)
|
||||||
{
|
{
|
||||||
CFRelease(valueRef);
|
|
||||||
CFRelease(propsRef);
|
CFRelease(propsRef);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -412,7 +404,6 @@ void _glfwInitJoysticks(void)
|
|||||||
joystick->name,
|
joystick->name,
|
||||||
sizeof(joystick->name),
|
sizeof(joystick->name),
|
||||||
kCFStringEncodingUTF8);
|
kCFStringEncodingUTF8);
|
||||||
CFRelease(valueRef);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
joystick->axisElements = CFArrayCreateMutable(NULL, 0, NULL);
|
joystick->axisElements = CFArrayCreateMutable(NULL, 0, NULL);
|
||||||
@ -427,8 +418,8 @@ void _glfwInitJoysticks(void)
|
|||||||
range,
|
range,
|
||||||
getElementsCFArrayHandler,
|
getElementsCFArrayHandler,
|
||||||
(void*) joystick);
|
(void*) joystick);
|
||||||
CFRelease(valueRef);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CFRelease(propsRef);
|
CFRelease(propsRef);
|
||||||
|
|
||||||
joystick->axes = calloc(CFArrayGetCount(joystick->axisElements),
|
joystick->axes = calloc(CFArrayGetCount(joystick->axisElements),
|
||||||
|
Loading…
Reference in New Issue
Block a user