Remove the extraneous call to IOHIDDeviceClose() in the read_thread()

The call is also made in hid_close(). Thanks to Vitali Lovich for pointing this out.
This commit is contained in:
Alan Ott
2011-12-30 17:10:19 -05:00
parent c43255b4b3
commit d019a9ba4f
-7
View File
@@ -704,13 +704,6 @@ static void *read_thread(void *param)
pthread_cond_broadcast(&dev->condition);
pthread_mutex_unlock(&dev->mutex);
/* Close the OS handle to the device, but only if it's not
been unplugged. If it's been unplugged, then calling
IOHIDDeviceClose() will crash. */
if (!dev->disconnected) {
IOHIDDeviceClose(dev->device_handle, kIOHIDOptionsTypeNone);
}
/* Wait here until hid_close() is called and makes it past
the call to CFRunLoopWakeUp(). This thread still needs to
be valid when that function is called on the other thread. */