From fd80dc816cee13c009c03005f5790322f3dd2162 Mon Sep 17 00:00:00 2001 From: ViusualSJ Date: Wed, 18 May 2016 18:28:30 +0800 Subject: [PATCH 1/2] Fixed a bug about remove loader item --- cocos2d/core/load-pipeline/loading-items.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/cocos2d/core/load-pipeline/loading-items.js b/cocos2d/core/load-pipeline/loading-items.js index 6853b896ed..06689c5ac9 100644 --- a/cocos2d/core/load-pipeline/loading-items.js +++ b/cocos2d/core/load-pipeline/loading-items.js @@ -241,12 +241,20 @@ JS.mixin(LoadingItems.prototype, CallbacksInvoker.prototype, { * @param {String} url */ removeItem: function (url) { - if (this.completed[url]) { - delete this.completed[url]; - delete this.map[url]; - this.completedCount--; - this.totalCount--; + var item = this.map[url]; + if (!item) return; + + if (!this.completed[item.alias || url]) return; + + delete this.completed[url]; + delete this.map[url]; + if (item.alias) { + delete this.completed[item.alias]; + delete this.map[item.alias]; } + + this.completedCount--; + this.totalCount--; }, complete: function (url) { From a3b10ad4b5011ad7968d98bb0e56cb4828b0088d Mon Sep 17 00:00:00 2001 From: ViusualSJ Date: Wed, 18 May 2016 18:29:08 +0800 Subject: [PATCH 2/2] change ONLY_ONE --- cocos2d/core/platform/CCSys.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos2d/core/platform/CCSys.js b/cocos2d/core/platform/CCSys.js index 7298730bf8..8129c1e7fd 100644 --- a/cocos2d/core/platform/CCSys.js +++ b/cocos2d/core/platform/CCSys.js @@ -747,7 +747,7 @@ else { // check Web Audio's context var supportWebAudio = !!(window.AudioContext || window.webkitAudioContext || window.mozAudioContext); - __audioSupport = { ONLY_ONE: true, WEB_AUDIO: supportWebAudio, DELAY_CREATE_CTX: false }; + __audioSupport = { ONLY_ONE: false, WEB_AUDIO: supportWebAudio, DELAY_CREATE_CTX: false }; if (sys.browserType === sys.BROWSER_TYPE_FIREFOX) { __audioSupport.DELAY_CREATE_CTX = true;