android: fix java.util.ConcurrentModificationException

This commit is contained in:
pengfei.zhou 2022-06-17 10:40:18 +08:00 committed by osborn
parent 6efd008841
commit fc94230df2

View File

@ -67,12 +67,22 @@ public class DoricPerformanceProfile {
return this.name; return this.name;
} }
public void addAnchorHook(AnchorHook hook) { public void addAnchorHook(final AnchorHook hook) {
this.hooks.add(hook); performanceHandler.post(new Runnable() {
@Override
public void run() {
hooks.add(hook);
}
});
} }
public void removeAnchorHook(AnchorHook hook) { public void removeAnchorHook(final AnchorHook hook) {
this.hooks.remove(hook); performanceHandler.post(new Runnable() {
@Override
public void run() {
hooks.remove(hook);
}
});
} }
public void enable(boolean enable) { public void enable(boolean enable) {