android: fix cancel cause modify map concurrently

This commit is contained in:
pengfei.zhou 2021-12-24 16:20:52 +08:00 committed by osborn
parent 24e704e1b9
commit 39e1fc98e2

View File

@ -32,6 +32,7 @@ import org.json.JSONObject;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.WeakHashMap; import java.util.WeakHashMap;
@ -191,7 +192,7 @@ public class DoricContext {
} }
public void teardown() { public void teardown() {
Set<String> animatorIds = animators.keySet(); Set<String> animatorIds = new HashSet<>(animators.keySet());
for (String animatorId : animatorIds) { for (String animatorId : animatorIds) {
Animator animator = animators.remove(animatorId); Animator animator = animators.remove(animatorId);
if (animator != null) { if (animator != null) {