-
Notifications
You must be signed in to change notification settings - Fork 27k
fix(http): cleanup JSONP script listeners once loading completed #57877
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
Conversation
This commit removes event listeners from the `script` element once loading is complete. If the element is not garbage collected properly, in Firefox, the script element still appears in the memory tree view, captured by `__zone_symbol__loadfalse -> HTMLScriptElement -> GC Roots`. We should always be good citizens and clean up event listeners when we no longer need them, as browser's garbage collectors work differently. Calling `remove()` on the node doesn't guarantee that the node can be collected.
JoostK
left a comment
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.
I don't think I'm a code owner, but LGTM.
|
Caretaker note: presubmit is "green", this PR is ready for merge. |
|
This PR was merged into the repository by commit 22dafa6. The changes were merged into the following branches: main, 18.2.x |
) This commit removes event listeners from the `script` element once loading is complete. If the element is not garbage collected properly, in Firefox, the script element still appears in the memory tree view, captured by `__zone_symbol__loadfalse -> HTMLScriptElement -> GC Roots`. We should always be good citizens and clean up event listeners when we no longer need them, as browser's garbage collectors work differently. Calling `remove()` on the node doesn't guarantee that the node can be collected. PR Close #57877
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This commit removes event listeners from the
scriptelement once loading iscomplete. If the element is not garbage collected properly, in Firefox, the script
element still appears in the memory tree view, captured by
__zone_symbol__loadfalse -> HTMLScriptElement -> GC Roots. We should always be goodcitizens and clean up event listeners when we no longer need them, as browser's garbage
collectors work differently. Calling
remove()on the node doesn't guarantee that thenode can be collected.