Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
middleLayer_for_NJ_lite
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
template admin
middleLayer_for_NJ_lite
Commits
21f98065
Commit
21f98065
authored
Sep 28, 2022
by
limingzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: debug 清内存
parent
1382cf18
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
23 deletions
+23
-23
middleLayerBase.ts
assets/middleLayer_for_NJ_lite/script/middleLayerBase.ts
+23
-23
No files found.
assets/middleLayer_for_NJ_lite/script/middleLayerBase.ts
View file @
21f98065
import
{
asyncDelay
}
from
"
./util
"
;
import
{
asyncDelay
,
randomSortByArr
}
from
"
./util
"
;
export
abstract
class
middleLayerBase
extends
cc
.
Component
{
...
...
@@ -429,12 +429,22 @@ export abstract class middleLayerBase extends cc.Component {
}
// this.atlasList[3] = this.atlasList[7];
// this.assetList[3] = this.assetList[7];
// this.nodeList[3] = this.nodeList[7];
// this.textureList[3] = this.textureList[7];
// this.assetList = randomSortByArr(this.assetList);
// this.atlasList[0] = this.atlasList[7];
// this.assetList[0] = this.assetList[7];
// this.nodeList[0] = this.nodeList[7]
// this.textureList[0] = this.textureList[7];
// this.atlasList.length = this.assetList.length = this.nodeList.length = this.textureList.length = 1;
// [ ...this.assetList ].forEach(asset => {
// console.log('asset_uuid: ', asset._uuid);
// console.log('asset: ', asset);
// cc.assetManager.releaseAsset(asset);
// });
// [ ...this.atlasList, ...this.assetList ].forEach(asset => {
// console.log('asset_uuid: ', asset._uuid);
// console.log('asset: ', asset);
...
...
@@ -450,14 +460,14 @@ export abstract class middleLayerBase extends cc.Component {
console
.
log
(
'
asset_uuid:
'
,
asset
.
_uuid
);
console
.
log
(
'
asset:
'
,
asset
);
// asset.decRef();
cc
.
assetManager
.
releaseAsset
(
asset
);
asset
.
destroy
();
while
(
asset
?.
refCount
>
0
)
{
asset
.
decRef
();
}
// asset.decRef();
// cc.assetManager.releaseAsset(asset);
// asset.destroy();
});
this
.
nodeList
.
forEach
(
node
=>
{
...
...
@@ -466,8 +476,8 @@ export abstract class middleLayerBase extends cc.Component {
});
this
.
textureList
.
forEach
(
texture
=>
{
console
.
log
(
'
texture_uuid:
'
,
texture
.
_uuid
);
console
.
log
(
'
texture:
'
,
texture
);
//
console.log('texture_uuid: ', texture._uuid);
//
console.log('texture: ', texture);
while
(
texture
?.
refCount
>
0
)
{
texture
.
decRef
();
...
...
@@ -478,18 +488,8 @@ export abstract class middleLayerBase extends cc.Component {
});
[
...
this
.
assetList
].
forEach
(
asset
=>
{
console
.
log
(
'
asset_uuid:
'
,
asset
.
_uuid
);
console
.
log
(
'
asset:
'
,
asset
);
cc
.
assetManager
.
releaseUnusedAssets
();
cc
.
assetManager
.
releaseUnusedAssets
();
// asset.decRef();
// cc.assetManager.releaseAsset(asset);
// asset.destroy();
});
// this.atlasList.length = this.assetList.length = this.nodeList.length = this.textureList.length = 1;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment