mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-21 03:52:48 +00:00
Wait for control stream threads to terminate. Terminate resync thread that was retaining the NvConnection object and all its children.
This commit is contained in:
parent
666fbecc01
commit
95d035f00b
@ -103,17 +103,33 @@ public class ControlStream implements ConnectionStatusListener {
|
|||||||
|
|
||||||
aborting = true;
|
aborting = true;
|
||||||
|
|
||||||
|
try {
|
||||||
|
s.close();
|
||||||
|
} catch (IOException e) {}
|
||||||
|
|
||||||
if (jitterThread != null) {
|
if (jitterThread != null) {
|
||||||
jitterThread.interrupt();
|
jitterThread.interrupt();
|
||||||
|
|
||||||
|
try {
|
||||||
|
jitterThread.join();
|
||||||
|
} catch (InterruptedException e) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (heartbeatThread != null) {
|
if (heartbeatThread != null) {
|
||||||
heartbeatThread.interrupt();
|
heartbeatThread.interrupt();
|
||||||
|
|
||||||
|
try {
|
||||||
|
heartbeatThread.join();
|
||||||
|
} catch (InterruptedException e) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
if (resyncThread != null) {
|
||||||
s.close();
|
resyncThread.interrupt();
|
||||||
} catch (IOException e) {}
|
|
||||||
|
try {
|
||||||
|
resyncThread.join();
|
||||||
|
} catch (InterruptedException e) {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void requestResync() throws IOException
|
public void requestResync() throws IOException
|
||||||
@ -150,6 +166,7 @@ public class ControlStream implements ConnectionStatusListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
heartbeatThread.setName("Control - Heartbeat Thread");
|
||||||
heartbeatThread.start();
|
heartbeatThread.start();
|
||||||
|
|
||||||
resyncThread = new Thread() {
|
resyncThread = new Thread() {
|
||||||
@ -176,6 +193,7 @@ public class ControlStream implements ConnectionStatusListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
resyncThread.setName("Control - Resync Thread");
|
||||||
resyncThread.start();
|
resyncThread.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -202,6 +220,7 @@ public class ControlStream implements ConnectionStatusListener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
jitterThread.setName("Control - Jitter Thread");
|
||||||
jitterThread.start();
|
jitterThread.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user