Skip to content

Suspects LocalString would cause memory leak when created with a native string #414

Description

@YiRanMushroom

I was writing a Kotlin Scripting Engine and when I was trying to implement a native function wrapper, I wrote many tests to check if my implementation was correct.

Unfortunately, I found out there are some memory leaks, after over 5 hours of debugging, I found out that LocalStrings created by a native C++ String would not be released in time (if any of them would ever get released).

My question is whether this is the expected behaviour (I suspect not, since LocalObject and LocalArray have no such problem), and if it is the expected behaviour, what is the best way to pass a string to Java? Or whether and when this would be fixed if there is a bug.

Thank you for your attention to this matter.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Fields

No fields configured for Bug.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions