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

CreateCopy is now the default for locals. #210

Closed
wants to merge 0 commits into from

Conversation

copybara-service[bot]
Copy link

@copybara-service copybara-service bot commented Nov 12, 2023

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 using AdoptLocal 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 add AdoptLocal{} to duplicate existing behaviour.

@copybara-service copybara-service bot force-pushed the test_577476928 branch 10 times, most recently from 5f48d19 to 8e8f56c Compare November 13, 2023 20:34
@copybara-service copybara-service bot closed this Nov 13, 2023
@copybara-service copybara-service bot deleted the test_577476928 branch November 13, 2023 20:42
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.

0 participants