[Mac] Do not call CFRelease on HID properties
authorthefiddler <stapostol@gmail.com>
Sun, 5 Jan 2014 20:27:34 +0000 (21:27 +0100)
committerthefiddler <stapostol@gmail.com>
Sun, 5 Jan 2014 20:27:34 +0000 (21:27 +0100)
HID properties are callee-owned and should not be released by the
caller. Fixes crash (memory corruption) on device hot plugging.

Source/OpenTK/Platform/MacOS/HIDInput.cs

index 382e1f9..6deb0b9 100755 (executable)
@@ -408,7 +408,6 @@ namespace OpenTK.Platform.MacOS
 
                 CFStringRef name_ref = NativeMethods.IOHIDDeviceGetProperty(device, NativeMethods.IOHIDProductKey);
                 string name = CF.CFStringGetCString(name_ref);
-                CF.CFRelease(name_ref);
 
                 List<int> button_elements = new List<int>();
                 CFArray element_array = new CFArray(element_array_ref);