-
Notifications
You must be signed in to change notification settings - Fork 15.4k
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: in Emit()
, don't leak converted Arg Local<Values>
into caller's scope
#43729
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ckerr
added
semver/patch
backwards-compatible bug fixes
target/30-x-y
PR should also be added to the "30-x-y" branch.
target/31-x-y
PR should also be added to the "31-x-y" branch.
target/32-x-y
PR should also be added to the "32-x-y" branch.
target/33-x-y
PR should also be added to the "33-x-y" branch.
labels
Sep 16, 2024
codebytere
changed the title
fix: in Emit(), don't leak converted Arg Local<Values> into caller's scope
fix: in Sep 16, 2024
Emit()
, don't leak converted Arg Local<Values>
into caller's scope
codebytere
approved these changes
Sep 16, 2024
No Release Notes |
This was referenced Sep 17, 2024
I have automatically backported this PR to "33-x-y", please check out #43746 |
trop
bot
added
in-flight/33-x-y
and removed
target/33-x-y
PR should also be added to the "33-x-y" branch.
labels
Sep 17, 2024
I have automatically backported this PR to "32-x-y", please check out #43747 |
I have automatically backported this PR to "31-x-y", please check out #43748 |
I have automatically backported this PR to "30-x-y", please check out #43749 |
trop
bot
added
in-flight/32-x-y
in-flight/31-x-y
in-flight/30-x-y
and removed
target/32-x-y
PR should also be added to the "32-x-y" branch.
target/31-x-y
PR should also be added to the "31-x-y" branch.
target/30-x-y
PR should also be added to the "30-x-y" branch.
labels
Sep 17, 2024
3 tasks
trop
bot
added
merged/33-x-y
PR was merged to the "33-x-y" branch.
merged/30-x-y
PR was merged to the "30-x-y" branch.
merged/32-x-y
PR was merged to the "32-x-y" branch.
merged/31-x-y
PR was merged to the "31-x-y" branch.
and removed
in-flight/33-x-y
in-flight/30-x-y
in-flight/32-x-y
in-flight/31-x-y
labels
Sep 17, 2024
yangannyx
pushed a commit
to yangannyx/electron
that referenced
this pull request
Oct 21, 2024
…r's scope (electron#43729) fix: Emit() should not leak converted arg handles into caller's HandleScope
yangannyx
pushed a commit
to yangannyx/electron
that referenced
this pull request
Oct 21, 2024
…r's scope (electron#43729) fix: Emit() should not leak converted arg handles into caller's HandleScope
yangannyx
pushed a commit
to yangannyx/electron
that referenced
this pull request
Oct 21, 2024
…r's scope (electron#43729) fix: Emit() should not leak converted arg handles into caller's HandleScope
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
merged/30-x-y
PR was merged to the "30-x-y" branch.
merged/31-x-y
PR was merged to the "31-x-y" branch.
merged/32-x-y
PR was merged to the "32-x-y" branch.
merged/33-x-y
PR was merged to the "33-x-y" branch.
semver/patch
backwards-compatible bug fixes
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Change
The two
Emit(isolate, obj, name, Args&&... args)
methods convertargs
into an array ofLocal<Value>s
to pass to Node/V8. But they don't use a HandleScope, so these temporary handles are leaked into the caller's scopes.In most calls this is OK since either
args
is empty or since the caller creates a scope right before emission, but not everywhere. It's more reliable to handle this in theEmit()
functions, so this PR addsEscapableHandleScope
s to plug the leaks.Checklist
npm test
passesRelease Notes
Notes: none.