CreateCopy
is now the default for locals.
#210
Closed
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.
CreateCopy
is now the default for locals.This follows from the discussion on #207.
Values passed through JNI are seemingly owned by the calling context and should not be deleted. This changes behaviour in existing applications, but at most should harmlessly leak a single local reference to a jobject.
This could be a break a breaking change if locally created JNI objects were being wrapped by a
LocalObject
in an inner loop, but can be obviated by usingAdoptLocal
anywhere this is done.This also could break if you are passing nulls to objects (which is not allowed but would passively fail).
Because
LocalObject<kClass>{input_obj}
is a "default path", this is going to become the default. All existing usages can addAdoptLocal{}
to duplicate existing behaviour.