Skip to content

Commit

Permalink
[Mac] Call DeviceRemoved() in Dispose() event
Browse files Browse the repository at this point in the history
The necessary cleanup code already exists in DeviceRemoved(). No need
to duplicate this in the Dispose() event.
  • Loading branch information
thefiddler committed Jan 5, 2014
1 parent ab85afd commit a112383
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Source/OpenTK/Platform/MacOS/HIDInput.cs
Expand Up @@ -1545,14 +1545,17 @@ void Dispose(bool manual)

foreach (var device in MouseDevices.Keys)
{
NativeMethods.IOHIDDeviceRegisterInputValueCallback(
device, IntPtr.Zero, IntPtr.Zero);
DeviceRemoved(IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, device);
}

foreach (var device in KeyboardDevices.Keys)
{
NativeMethods.IOHIDDeviceRegisterInputValueCallback(
device, IntPtr.Zero, IntPtr.Zero);
DeviceRemoved(IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, device);
}

foreach (var device in JoystickDevices.Keys)
{
DeviceRemoved(IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, device);
}

HandleDeviceAdded = null;
Expand Down

0 comments on commit a112383

Please sign in to comment.