[]skin 大于512 的释放问题
setData(type: number, fight: number): void {
this.imgItem = new Image();
this.imgItem.skin = 'forging/000' + (type + 1) + '.png';
this.imgItem.y = type * 231;
this.name = type + "";
this.showFight(fight);
}
showFight(num: number): void {
if (this._sprFight) this._sprFight.graphics.clear();
this._sprFight = bigao.utils.TextrueUtils.getNumberByUrl(resourcesCenter.ResourcesPathStr.FIGHT_NUMBER_PATH_PNG, num.toString());
this._sprFight.x = 600;
this._sprFight.y = 150;
this.addChild(this._sprFight);
}
dispose(): void {
this.imgItem.graphics.clear();
this.imgItem.removeSelf();
this.imgItem.skin = null;
this._sprFight.graphics.clear();
this._sprFight.removeSelf();
this._sprFight = null;
}
像这样写 dispose(),后, imgItem 的skin ( 'forging/000' + (type + 1) + '.png') 会不会自动从内存释放掉
没有找到相关结果
已邀请:
要回复问题请先登录
1 个回复
cuixueying
赞同来自: