mirror of
https://github.com/YTVanced/VancedMicroG
synced 2024-11-24 12:15:12 +00:00
Merge pull request #77 from michitux/teardown_fixes
Fixes for connectivity issues
This commit is contained in:
commit
381da4b2b3
2 changed files with 2 additions and 1 deletions
|
@ -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) {
|
||||||
|
|
|
@ -323,7 +323,7 @@ public class McsService extends Service implements Handler.Callback {
|
||||||
|
|
||||||
private void sendOutputStream(int what, Object obj) {
|
private void sendOutputStream(int what, Object obj) {
|
||||||
McsOutputStream os = outputStream;
|
McsOutputStream os = outputStream;
|
||||||
if (os != null) {
|
if (os != null && os.isAlive()) {
|
||||||
Handler outputHandler = os.getHandler();
|
Handler outputHandler = os.getHandler();
|
||||||
if (outputHandler != null)
|
if (outputHandler != null)
|
||||||
outputHandler.sendMessage(outputHandler.obtainMessage(what, obj));
|
outputHandler.sendMessage(outputHandler.obtainMessage(what, obj));
|
||||||
|
|
Loading…
Reference in a new issue