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;
|
||||
|
||||
try {
|
||||
s.close();
|
||||
} catch (IOException e) {}
|
||||
|
||||
if (jitterThread != null) {
|
||||
jitterThread.interrupt();
|
||||
|
||||
try {
|
||||
jitterThread.join();
|
||||
} catch (InterruptedException e) {}
|
||||
}
|
||||
|
||||
if (heartbeatThread != null) {
|
||||
heartbeatThread.interrupt();
|
||||
}
|
||||
|
||||
try {
|
||||
s.close();
|
||||
} catch (IOException e) {}
|
||||
heartbeatThread.join();
|
||||
} catch (InterruptedException e) {}
|
||||
}
|
||||
|
||||
if (resyncThread != null) {
|
||||
resyncThread.interrupt();
|
||||
|
||||
try {
|
||||
resyncThread.join();
|
||||
} catch (InterruptedException e) {}
|
||||
}
|
||||
}
|
||||
|
||||
public void requestResync() throws IOException
|
||||
@ -150,6 +166,7 @@ public class ControlStream implements ConnectionStatusListener {
|
||||
}
|
||||
}
|
||||
};
|
||||
heartbeatThread.setName("Control - Heartbeat Thread");
|
||||
heartbeatThread.start();
|
||||
|
||||
resyncThread = new Thread() {
|
||||
@ -176,6 +193,7 @@ public class ControlStream implements ConnectionStatusListener {
|
||||
}
|
||||
}
|
||||
};
|
||||
resyncThread.setName("Control - Resync Thread");
|
||||
resyncThread.start();
|
||||
}
|
||||
|
||||
@ -202,6 +220,7 @@ public class ControlStream implements ConnectionStatusListener {
|
||||
}
|
||||
}
|
||||
};
|
||||
jitterThread.setName("Control - Jitter Thread");
|
||||
jitterThread.start();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user