[LayaAir 2.0]百度小游戏 内存不断增大的情况
__proto.onConfigLoaded=function(){
Laya.init(600,400);
Laya.loader.load([{url:"res/atlas/comp.json",type:"atlas"}],Handler.create(this,this.onLoadUi));
}
__proto.onLoadUi=function(){
Laya.timer.loop(100,this,this.onLoaded);
}
__proto.onLoaded=function(){
if(this.isOpen){
return;
}
this.isOpen=true;
var testView=new TestView();
Laya.stage.addChild(testView);
Laya.timer.once(200,this,this.removeUi,[testView]);
}
__proto.removeUi=function(ui){
if(ui!=null){
ui.destroy();
this.isOpen=false;
}
}
代码主要是做了重复打开关闭一个界面,调用界面的destroy方法,运行一段时间发现内存在不断增大。请问这是BUG还是我的代码写的不对。
Laya引擎版本是 2.0.1beta
百度开发者工具版本是2.2.4 编译工具版本2.1.0 库版本是1.7.4
测试demo:
没有找到相关结果
已邀请:
要回复问题请先登录
1 个回复
Aar0n
赞同来自: