|
@@ -771,7 +771,7 @@ static void *read_thread(void *param)
|
|
while (!dev->shutdown_thread && !dev->disconnected) {
|
|
while (!dev->shutdown_thread && !dev->disconnected) {
|
|
code = CFRunLoopRunInMode(dev->run_loop_mode, 1000/*sec*/, FALSE);
|
|
code = CFRunLoopRunInMode(dev->run_loop_mode, 1000/*sec*/, FALSE);
|
|
/* Return if the device has been disconnected */
|
|
/* Return if the device has been disconnected */
|
|
- if (code == kCFRunLoopRunFinished) {
|
|
|
|
|
|
+ if (code == kCFRunLoopRunFinished || code == kCFRunLoopRunStopped) {
|
|
dev->disconnected = 1;
|
|
dev->disconnected = 1;
|
|
break;
|
|
break;
|
|
}
|
|
}
|