Merge pull request #1221 from pandamicro/v1.3

修复编辑器中初次动态加载 tilemap 不成功的问题
This commit is contained in:
Wang Nan
2016-10-20 10:32:38 +08:00
committed by GitHub
+8 -8
View File
@@ -191,13 +191,13 @@ JS.mixin(CCLoader.prototype, {
completeCallback.call(self, errors, items);
}
completeCallback = null;
items.destroy();
if (CC_EDITOR) {
for (var i = 0; i < resources.length; i++) {
self.removeItem(resources[i].id || resources[i]);
for (var id in self._cache) {
self.removeItem(id);
}
}
items.destroy();
});
});
},
@@ -416,7 +416,7 @@ JS.mixin(CCLoader.prototype, {
*/
getRes: function (url) {
var item = this._cache[url];
if (item.alias) {
if (item && item.alias) {
item = this._cache[item.alias];
}
if (!item) {
@@ -435,13 +435,13 @@ JS.mixin(CCLoader.prototype, {
},
/**
* Release the cache of resource by url.
* Release the cache of resource by id which is usually the url.
*
* @method release
* @param {String} url
* @param {String} id
*/
release: function (url) {
this.removeItem(url);
release: function (id) {
this.removeItem(id);
},
/**