mirror of
				https://github.com/glfw/glfw.git
				synced 2025-11-04 14:16:42 +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 =
 | 
			
		||||
        IOHIDDeviceCopyMatchingElements(device, NULL, kIOHIDOptionsTypeNone);
 | 
			
		||||
 | 
			
		||||
    if (elements)
 | 
			
		||||
    {
 | 
			
		||||
        for (CFIndex i = 0;  i < CFArrayGetCount(elements);  i++)
 | 
			
		||||
        {
 | 
			
		||||
            IOHIDElementRef native = (IOHIDElementRef)
 | 
			
		||||
@ -259,6 +261,7 @@ static void matchCallback(void* context,
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        CFRelease(elements);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    CFArraySortValues(axes, CFRangeMake(0, CFArrayGetCount(axes)),
 | 
			
		||||
                      compareElements, NULL);
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user