下面写的释放有什么问题吗?为什么我的内存没有变化,Laya.loader下面的_infoPoll 没有发生变化,
public dispose(): void {
this.ani.clear();
Laya.Animation.clearCache(this.resUrl);
this.ani = null;
Laya.loader.clearRes(this.resUrl, true);
}
我单独写了一个例子,这样释放没有问题,内存明显有变化,但是Laya.loader下面的_infoPoll 没有发生变化,就是还有res/atlas/effect/playerEff/shengji.json的信息。
for (let i = len - 1; i >= 0; i--) {
key = this._poolDic.keys
temp = this._poolDic.get(key);
if (temp) {
this._poolDic.remove(key);
temp.clear();
Laya.Animation.clearCache(key);
Laya.loader.clearRes('res/atlas/effect/playerEff/shengji.json');
}
}
问: 内存释放原理是什么样的?
附件:
T17_cleartAnimation.zip