-
-
Notifications
You must be signed in to change notification settings - Fork 300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix the problem that there is no cleanup script when direct gc. #1716
Fix the problem that there is no cleanup script when direct gc. #1716
Conversation
Demo:
|
Entity destroy shouldn't dependent |
@@ -132,7 +132,6 @@ export class ComponentsManager { | |||
script.onStart(); | |||
} | |||
} | |||
onStartScripts.length = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete this will cause performance problem
this._onPhysicsUpdateScripts.garbageCollection(); | ||
this._onUpdateAnimations.garbageCollection(); | ||
this._onUpdateRenderers.garbageCollection(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this._elements.length = this.length;
can save memory
_gc(): void { | ||
this._colliders.garbageCollection(); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the same before
this._spotLights.garbageCollection(); | ||
this._pointLights.garbageCollection(); | ||
this._directLights.garbageCollection(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the same before
Fixed in: #1724 |
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
What is the current behavior? (You can also link to an open issue here)
What is the new behavior (if this is a feature change)?
Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
Other information: