[LayaAir 2.0]bug:laya.Scene.destroy

var list=laya.display.Scene.unDestroyedScenes;
for (var i=0,n=list.length;i < n;i++){//这里缓存了长度,但是在
__proto.destroy=function(destroyChild){
(destroyChild===void 0)&& (destroyChild=true);
this._idMap=null;
_super.prototype.destroy.call(this,destroyChild);
var list=laya.display.Scene.unDestroyedScenes;
for (var i=0,n=list.length;i < n;i++){
if (list[i]===this){
list.splice(i,1);
return;
}
}
}这里改动了同一个数组,导致上面的循环越界
已邀请:

Aar0n

赞同来自:

能否提供一下demo,是在哪种情况下调用才触发越界的。

dasonjack

赞同来自:

Laya.Scene.open('test/TestView1.scene',false)
Laya.Scene.open('test/TestView2.scene',false)
Laya.Scene.open('test/TestView3.scene',false)
当有多个场景时候,destroy中间的场景就有问题
Laya.Scene.destroy('test/TestView2.scene')
=================================laya.display.Scene.unDestroyedScenes这个数组

要回复问题请先

商务合作
商务合作