mirror of https://github.com/YTVanced/VancedMicroG
McsInputStream: terminate if error occurred
This terminates the input stream when an error occurred and does not wait for the handler thread in the McsService to send the interrupt signal. This hopefully fixes a situation that I had where tear down messages were created in a busy loop because of repeatedly reading -1 from the input (I don't know how it got into the situation as the log was filled with the messages from the tear down).
This commit is contained in:
parent
affce9dc23
commit
3636f18d84
|
@ -77,6 +77,7 @@ public class McsInputStream extends Thread {
|
||||||
mainHandler.dispatchMessage(mainHandler.obtainMessage(MSG_INPUT, msg));
|
mainHandler.dispatchMessage(mainHandler.obtainMessage(MSG_INPUT, msg));
|
||||||
} else {
|
} else {
|
||||||
mainHandler.dispatchMessage(mainHandler.obtainMessage(MSG_TEARDOWN, "null message"));
|
mainHandler.dispatchMessage(mainHandler.obtainMessage(MSG_TEARDOWN, "null message"));
|
||||||
|
break; // if input is empty, do not continue looping
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|
Loading…
Reference in New Issue