mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-19 19:13:03 +00:00
Fix a crash and a hang in the new computer manager code
This commit is contained in:
parent
ebd93a55a0
commit
72d3576257
@ -508,7 +508,7 @@ public class ComputerManagerService extends Service {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return !thread.isInterrupted();
|
return thread != null && !thread.isInterrupted();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void start() {
|
public void start() {
|
||||||
@ -553,7 +553,10 @@ public class ComputerManagerService extends Service {
|
|||||||
computer.rawAppList = appList;
|
computer.rawAppList = appList;
|
||||||
|
|
||||||
// Notify that the app list has been updated
|
// Notify that the app list has been updated
|
||||||
|
// and ensure that the thread is still active
|
||||||
|
if (listener != null && thread != null) {
|
||||||
listener.notifyComputerUpdated(computer);
|
listener.notifyComputerUpdated(computer);
|
||||||
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@ -567,9 +570,7 @@ public class ComputerManagerService extends Service {
|
|||||||
if (thread != null) {
|
if (thread != null) {
|
||||||
thread.interrupt();
|
thread.interrupt();
|
||||||
|
|
||||||
try {
|
// Don't join here because we might be blocked on network I/O
|
||||||
thread.join();
|
|
||||||
} catch (InterruptedException e) {}
|
|
||||||
|
|
||||||
thread = null;
|
thread = null;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user