Skip to content

JavaKit: clear exception before initializing Throwable #145

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

Merged
merged 1 commit into from
Nov 1, 2024

Conversation

lhoward
Copy link
Contributor

@lhoward lhoward commented Oct 31, 2024

Initializing Throwable with an exception calls the JNI method NewGlobalRef, which on Android cannot be called while an exception is pending. [1] Clear the exception first before initializing the Throwable.

[1] https://developer.android.com/training/articles/perf-jni.html#exceptions_1

Initializing Throwable with an exception calls the JNI method NewGlobalRef,
which on Android cannot be called while an exception is pending. [1] Clear the
exception first before initializing the Throwable.

[1] https://developer.android.com/training/articles/perf-jni.html#exceptions_1
@lhoward lhoward marked this pull request as ready for review October 31, 2024 23:38
Copy link
Collaborator

@ktoso ktoso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok to me 👍

@ktoso ktoso added the android label Oct 31, 2024
@lhoward
Copy link
Contributor Author

lhoward commented Nov 1, 2024

Closes #143

@ktoso ktoso merged commit 114ef73 into swiftlang:main Nov 1, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants