mirror of
https://github.com/glfw/glfw.git
synced 2025-04-18 14:42:52 +00:00
Cocoa: Fix segfault
This fixes a segfault caused by missing input monitoring permissions for a connected controller / gamepad.
This commit is contained in:
parent
3fa2360720
commit
d577f1d0e7
@ -182,6 +182,8 @@ static void matchCallback(void* context,
|
|||||||
CFArrayRef elements =
|
CFArrayRef elements =
|
||||||
IOHIDDeviceCopyMatchingElements(device, NULL, kIOHIDOptionsTypeNone);
|
IOHIDDeviceCopyMatchingElements(device, NULL, kIOHIDOptionsTypeNone);
|
||||||
|
|
||||||
|
if (elements)
|
||||||
|
{
|
||||||
for (CFIndex i = 0; i < CFArrayGetCount(elements); i++)
|
for (CFIndex i = 0; i < CFArrayGetCount(elements); i++)
|
||||||
{
|
{
|
||||||
IOHIDElementRef native = (IOHIDElementRef)
|
IOHIDElementRef native = (IOHIDElementRef)
|
||||||
@ -259,6 +261,7 @@ static void matchCallback(void* context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
CFRelease(elements);
|
CFRelease(elements);
|
||||||
|
}
|
||||||
|
|
||||||
CFArraySortValues(axes, CFRangeMake(0, CFArrayGetCount(axes)),
|
CFArraySortValues(axes, CFRangeMake(0, CFArrayGetCount(axes)),
|
||||||
compareElements, NULL);
|
compareElements, NULL);
|
||||||
|
Loading…
Reference in New Issue
Block a user