[]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') 会不会自动从内存释放掉
已邀请:

cuixueying

赞同来自:

大于512的图片,如果你手动清理了,是可以清理掉的!

要回复问题请先

商务合作
商务合作