From f79bd6388a467c7831b3772d46a74d36f8782bd3 Mon Sep 17 00:00:00 2001 From: ctiao Date: Tue, 8 Sep 2015 17:55:59 +0800 Subject: [PATCH] DrawTask: fix a ConcurrentModificationException --- .../main/java/master/flame/danmaku/controller/DrawTask.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/DanmakuFlameMaster/src/main/java/master/flame/danmaku/controller/DrawTask.java b/DanmakuFlameMaster/src/main/java/master/flame/danmaku/controller/DrawTask.java index f29f50c9..dee8deb4 100644 --- a/DanmakuFlameMaster/src/main/java/master/flame/danmaku/controller/DrawTask.java +++ b/DanmakuFlameMaster/src/main/java/master/flame/danmaku/controller/DrawTask.java @@ -108,7 +108,9 @@ public synchronized void addDanmaku(BaseDanmaku item) { } else if (item.isLive) { mLastBeginMills = mLastEndMills = 0; } - added = danmakuList.addItem(item); + synchronized (danmakuList) { + added = danmakuList.addItem(item); + } if (added && mTaskListener != null) { mTaskListener.onDanmakuAdd(item); }