Browse files

[Mac] Do not call CFRelease on HID properties

HID properties are callee-owned and should not be released by the
caller. Fixes crash (memory corruption) on device hot plugging.
  • Loading branch information...
1 parent 02c9f47 commit 05af21e61b215737f8d1a24abc898a91e476d06a @thefiddler thefiddler committed Jan 5, 2014
Showing with 0 additions and 1 deletion.
  1. +0 −1 Source/OpenTK/Platform/MacOS/HIDInput.cs
@@ -408,7 +408,6 @@ MacJoystick CreateJoystick(CFAllocatorRef sender, CFAllocatorRef device)
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);

0 comments on commit 05af21e

Please sign in to comment.