Skip to content
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

Allow dropping of string&buffer values when converting #582

Merged
merged 1 commit into from May 27, 2021

Conversation

pimeys
Copy link
Contributor

@pimeys pimeys commented May 27, 2021

The utf8 and utf16 values leak memory a lot, if we don't handle the ManuallyDrop values. This fix is first try of changing it. I'd remove the ManuallyDrop values completely, but I don't know are they actually needed elsewhere in the code.

Closes: #581

@Brooooooklyn
Copy link
Sponsor Member

Looks good to me! I can't remember why JsStringUtf8 and JsStringUtf16 implemented with ManuallyDrop, but I'm sure that they shoule be drop while dropping the JsStringUtf8 and JsStringUtf16.
Thanks!

@Brooooooklyn Brooooooklyn merged commit 33de299 into napi-rs:main May 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A memory leak in JsString::into_utf8
2 participants