-
Notifications
You must be signed in to change notification settings - Fork 237
[C#] Fixes mem leak on string pointer #1389
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
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.
Pull Request Overview
Fix memory leak in C# codegen for string lifting by freeing the unmanaged buffer after decoding to a managed string.
- Introduce a temporary variable for the lifted string and immediately free the unmanaged pointer.
- Adjust result handling to use the temporary variable rather than an inline expression.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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.
Pull Request Overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
So the final solution is to check for |
Covered cases |
LGMT, @yowl , @jsturtevant I would leave the approval with one of you |
The PR aims to fix #1377
Beside that other languages still leaking because of missing
free
calls in this case.wit file:
Generated code: