mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2025-07-19 19:13:03 +00:00
Fix a race condition
This commit is contained in:
parent
cd49334199
commit
7c39e5c974
@ -109,10 +109,13 @@ public class ComputerManagerService extends Service {
|
||||
if (runPoll(details) && !originalDetails.equals(details)) {
|
||||
// Replace our thread entry with the new one
|
||||
synchronized (pollingThreads) {
|
||||
pollingThreads.remove(originalDetails);
|
||||
if (pollingThreads.remove(originalDetails) != null) {
|
||||
// This could have gone away in the meantime, so don't
|
||||
// add it back if it has
|
||||
pollingThreads.put(details, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Wait until the next polling interval
|
||||
try {
|
||||
|
Loading…
x
Reference in New Issue
Block a user