Commit 7ce080df authored by limingzhe's avatar limingzhe

fix: debug 清缓存

parent aaeb3d81
......@@ -435,13 +435,33 @@ export abstract class middleLayerBase extends cc.Component {
// this.textureList[3] = this.textureList[7];
// this.atlasList.length = this.assetList.length = this.nodeList.length = this.textureList.length = 1;
// [ ...this.atlasList, ...this.assetList ].forEach(asset => {
// console.log('asset_uuid: ', asset._uuid);
// console.log('asset: ', asset);
// while (asset?.refCount > 0) {
// asset.decRef();
// }
// // cc.assetManager.releaseAsset(asset);
// // asset.destroy();
// });
[ ...this.atlasList, ...this.assetList ].forEach(asset => {
console.log('asset_uuid: ', asset._uuid);
console.log('asset: ', asset);
while (asset?.refCount > 0) {
asset.decRef();
try {
// asset.decRef();
while (asset?.refCount > 0) {
asset.decRef();
}
cc.assetManager.releaseAsset(asset);
asset.destroy();
} catch (error) {
console.log('try catch error: ', error);
}
// asset.decRef();
// cc.assetManager.releaseAsset(asset);
// asset.destroy();
});
......@@ -462,16 +482,9 @@ export abstract class middleLayerBase extends cc.Component {
this.atlasList.length = this.assetList.length = this.nodeList.length = this.textureList.length = 1;
[ ...this.atlasList, ...this.assetList ].forEach(asset => {
console.log('asset_uuid: ', asset._uuid);
console.log('asset: ', asset);
// this.atlasList.length = this.assetList.length = this.nodeList.length = this.textureList.length = 1;
// 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