start :function(){
var scene = cc.director.getScene();
this.p_node = cc.instantiate(this.node);
this.p_node.position = cc.v2(1,200);
this.p_node.parent = scene;
this.scheduleOnce(function() {
cc.log('**************************************');
this.p_node.destroy();
}, 2);
}
这段代码,cc.log会一直输出,但是官方文档中的说法应该是只会执行一次啊,
而且在执行的时候,我创建出来的一个图片没有被销毁,log则是一直输出 Object already destroyed ,
如果改成setTimeOut则会直接报出 destroy of null
start :function(){
var scene = cc.director.getScene();
this.p_node = cc.instantiate(this.node);
this.p_node.position = cc.v2(1,200);
this.p_node.parent = scene;
setTimeout(function(){
cc.log('**************************************');
this.p_node.destroy();
}.bind(this),2000);
}
而且,注释掉这段代码后,退出游戏时,'Destroy WebGLBuffer OR Destroy WebGLTesture by GC' 最多不会超过十个,加上之后,游戏运行一段时间退出就会到达几百个,是哪个方面出错了吗,求大佬解答一下 - - 场景中只有一个Canvas 和一个Sprite 脚本是挂在Sprite上的