Fix memory leak in Function::get_script_origin#1902
Open
goffrie wants to merge 1 commit intodenoland:mainfrom
Open
Fix memory leak in Function::get_script_origin#1902goffrie wants to merge 1 commit intodenoland:mainfrom
goffrie wants to merge 1 commit intodenoland:mainfrom
Conversation
goffrie
commented
Jan 21, 2026
| } | ||
|
|
||
| int v8__ScriptOrigin__ScriptId(const v8::ScriptOrigin& self) { | ||
| return ptr_to_local(&self)->ScriptId(); |
Contributor
Author
There was a problem hiding this comment.
also removed these ptr_to_local calls as v8::ScriptOrigin is not meant to be inside of a v8::Local<>, and at best this does nothing since Local::operator-> just returns the original pointer again.
54b31e6 to
12841bb
Compare
devsnek
reviewed
Jan 21, 2026
12841bb to
a9685d6
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Previously v8__Function__GetScriptOrigin returned a newly allocated object from the C++ heap, then the caller never freed it.
Return it by-value instead.
I believe a handle scope is also required, as Function::GetScriptOrigin internally creates Local handles.