mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2026-06-17 06:10:58 +00:00
Fix a race condition
This commit is contained in:
@@ -109,8 +109,11 @@ public class ComputerManagerService extends Service {
|
|||||||
if (runPoll(details) && !originalDetails.equals(details)) {
|
if (runPoll(details) && !originalDetails.equals(details)) {
|
||||||
// Replace our thread entry with the new one
|
// Replace our thread entry with the new one
|
||||||
synchronized (pollingThreads) {
|
synchronized (pollingThreads) {
|
||||||
pollingThreads.remove(originalDetails);
|
if (pollingThreads.remove(originalDetails) != null) {
|
||||||
pollingThreads.put(details, this);
|
// This could have gone away in the meantime, so don't
|
||||||
|
// add it back if it has
|
||||||
|
pollingThreads.put(details, this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user