move pipeline flowin before callback to prevent circular reference of prefab when loading scene.

This commit is contained in:
Nan Wang
2016-07-05 14:15:04 +08:00
parent e91227d8af
commit 90446d106c
+3 -4
View File
@@ -353,7 +353,6 @@ JS.mixin(Pipeline.prototype, {
*/
flowInDeps: function (urlList, callback) {
var checker = {};
var count = 0;
var items = this._items;
function loadedCheck (item) {
@@ -379,18 +378,18 @@ JS.mixin(Pipeline.prototype, {
if ( !item ) {
items.addListener(url, loadedCheck);
checker[url] = null;
count++;
}
else {
checker[url] = item;
}
}
var accepted = this.flowIn(urlList);
// No new resources, complete directly
if (count === 0) {
if (accepted.length === 0) {
callback && callback.call(this, checker);
callback = null;
}
return this.flowIn(urlList);
return accepted;
},
complete: function () {