From 836bb3c87db2664025edb219801419323fd89e79 Mon Sep 17 00:00:00 2001 From: pandamicro Date: Wed, 7 Jun 2017 16:31:52 +0800 Subject: [PATCH] Avoid duplicated asset entry in loader caused by synchronous process --- cocos2d/core/load-pipeline/pipeline.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cocos2d/core/load-pipeline/pipeline.js b/cocos2d/core/load-pipeline/pipeline.js index 47e510adce..1e3d9b567d 100644 --- a/cocos2d/core/load-pipeline/pipeline.js +++ b/cocos2d/core/load-pipeline/pipeline.js @@ -229,9 +229,13 @@ proto.appendPipe = function (pipe) { proto.flowIn = function (items) { var i, pipe = this._pipes[0], item; if (pipe) { + // Cache all items first, in case synchronous loading flow same item repeatly for (i = 0; i < items.length; i++) { item = items[i]; this._cache[item.id] = item; + } + for (i = 0; i < items.length; i++) { + item = items[i]; flow(pipe, item); } }