Commit 979e59a0 authored by limingzhe's avatar limingzhe

fix: debug 清缓存

parent a8b6a973
......@@ -418,11 +418,7 @@ export abstract class middleLayerBase extends cc.Component {
console.log('喵喵喵: ' + this.assetList.length);
console.log('喵喵喵: ' + this.textureList.length);
[...this.atlasList, ...this.assetList].forEach(asset => {
asset.decRef();
cc.assetManager.releaseAsset(asset);
asset.destroy();
});
this.nodeList.forEach(node => {
node.active = false;
......@@ -430,7 +426,18 @@ export abstract class middleLayerBase extends cc.Component {
});
this.textureList.forEach(texture => {
texture.decRef();
while (texture?.refCount) {
texture?.decRef();
}
});
[...this.atlasList, ...this.assetList].forEach(asset => {
while (asset?.refCount) {
asset?.decRef();
}
cc.assetManager.releaseAsset(asset);
asset.destroy();
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment