Fix flowInDeps call complete callback multiply times

This commit is contained in:
pandamicro
2016-03-10 18:43:15 +08:00
parent c26dd4b9df
commit ac555bde18
+4 -1
View File
@@ -335,12 +335,14 @@ JS.mixin(Pipeline.prototype, {
}
// All url completed
callback && callback.call(this, checker);
callback = null;
}
// Add loaded listeners
for (var i = 0; i < urlList.length; ++i) {
var url = urlList[i].id || urlList[i];
if (typeof url !== 'string')
if (typeof url !== 'string' || checker[url]) {
continue;
}
var item = items.map[url];
if ( !item ) {
items.addListener(url, loadedCheck);
@@ -354,6 +356,7 @@ JS.mixin(Pipeline.prototype, {
// No new resources, complete directly
if (count === 0) {
callback && callback.call(this, checker);
callback = null;
}
return this.flowIn(urlList);
},