显卡驱动停止响应,且大概率蓝屏,原来是Handler惹的祸,但原因是什么

问题来自于 http://ask.layabox.com/question/3673
 
谷歌浏览器直接崩,其他浏览器的话,也是CPU很高,操作窗口卡顿厉害
 
原因是一个run once = true的Handler,如果再次run就会导致死循环, 代码如下,项目文件我也打包上传了,求原因,
类B的onloaded方法会无限循环执行
 
testlaya.as
package
{
import laya.display.Stage;
import laya.webgl.WebGL;

public class testlaya
{
public function testlaya()
{
Laya.init(100, 100, WebGL);
Laya.stage.alignV = Stage.ALIGN_MIDDLE;
Laya.stage.alignH = Stage.ALIGN_CENTER;
Laya.stage.bgColor = "#ffffff";
new A();
}
}
}
package
{
import laya.utils.Handler;

public class A
{
public var completeHandler:Handler;
public function A()
{
completeHandler = Handler.create(this,onComplete,[this]);
completeHandler.run();
new B().load(completeHandler);
trace('A',completeHandler.method == null,completeHandler['_id'])
}

private function onComplete():void {
trace('haha')
}
}
}
package
{
import laya.utils.Handler;

public class B
{

private var _completeHandler:Handler;
public function B()
{
}

public function load(completeHandler:Handler):void
{
this._completeHandler = completeHandler;
Laya.loader.load('test.txt',Handler.create(this, onloaded));
}

private function onloaded():void
{
trace('B',_completeHandler.method == null,_completeHandler['_id'])
_completeHandler.run();
}
}
}
已邀请:

cuixueying

赞同来自:

好的,收到,我们来测试下!

要回复问题请先

商务合作
商务合作