-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
documentation ambiguous about callbacks returning String #671
Comments
It looks like the char* is freed by JNA and is tied to the lifetime of the source String? |
JNA does what it can to make things easier for you, but fundamentally you A native API that receives a buffer without explicit information w/r/t its Other, less desirable solutions are to document what's expected to be done On Thu, Jun 16, 2016 at 8:42 PM, Erik Bremen [email protected]
|
Thanks. That clarifies what we found in the source. The intention for opening the bug was that the docs could use a note that in every case where JNA might return a pointer to native code (String -> char*, Memory, etc) that JNA maintains responsibility for freeing it and that the memory is directly associated with the lifetime of the object in java being mapped. |
…ess#671) Motivation: We introduced a bug when updating the actions. Modifications: Fix version of settings action Result: Deploy workflow works again
If calling a java callback that returns String, the return type is translated to char* on the native side. The documentation is unclear, though, about the lifetime of the string. Is the memory owned by java or should it be freed by C?
The text was updated successfully, but these errors were encountered: