[Mac] Correctly unschedule HIDManager from run loop

This commit is contained in:
thefiddler 2014-01-05 20:17:03 +01:00
parent 4c7f6a92a7
commit 7388bd935d

View file

@ -818,6 +818,12 @@ namespace OpenTK.Platform.MacOS
CFRunLoop inCFRunLoop, CFRunLoop inCFRunLoop,
CFString inCFRunLoopMode); CFString inCFRunLoopMode);
[DllImport(hid)]
public static void IOHIDManagerUnscheduleFromRunLoop(
IOHIDManagerRef inIOHIDManagerRef,
CFRunLoop inCFRunLoop,
CFString inCFRunLoopMode);
[DllImport(hid)] [DllImport(hid)]
public static extern void IOHIDManagerSetDeviceMatching( public static extern void IOHIDManagerSetDeviceMatching(
IOHIDManagerRef manager, IOHIDManagerRef manager,
@ -1468,8 +1474,8 @@ namespace OpenTK.Platform.MacOS
hidmanager, IntPtr.Zero, IntPtr.Zero); hidmanager, IntPtr.Zero, IntPtr.Zero);
NativeMethods.IOHIDManagerRegisterDeviceRemovalCallback( NativeMethods.IOHIDManagerRegisterDeviceRemovalCallback(
hidmanager, IntPtr.Zero, IntPtr.Zero); hidmanager, IntPtr.Zero, IntPtr.Zero);
NativeMethods.IOHIDManagerScheduleWithRunLoop( NativeMethods.IOHIDManagerUnscheduleFromRunLoop(
hidmanager, IntPtr.Zero, IntPtr.Zero); hidmanager, RunLoop, InputLoopMode);
foreach (var device in MouseDevices.Keys) foreach (var device in MouseDevices.Keys)
{ {