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

Remove @CriticalNative usage #1592

Merged
merged 3 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ and this library adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed
- Android 15 (SDK level 35) support added for 16 KB memory page size
- The disposing logic of `TorClient` (the USD/ZEC rate fetching component) has been improved
- The broken disposing logic `TorClient.freeTorRuntime` for Android SDK API level 27 has been fixed

## [2.2.3] - 2024-09-09

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ class TorClient private constructor(
@Throws(RuntimeException::class)
private external fun createTorRuntime(torDir: String): Long

@CriticalNative
@JvmStatic
private external fun freeTorRuntime(nativeHandle: Long)

Expand Down
6 changes: 5 additions & 1 deletion backend-lib/src/main/rust/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1985,7 +1985,11 @@ pub extern "C" fn Java_cash_z_ecc_android_sdk_internal_model_TorClient_createTor

/// Frees a Tor runtime.
#[no_mangle]
pub extern "C" fn Java_cash_z_ecc_android_sdk_internal_model_TorClient_freeTorRuntime(ptr: jlong) {
pub extern "C" fn Java_cash_z_ecc_android_sdk_internal_model_TorClient_freeTorRuntime<'local>(
_: JNIEnv<'local>,
_: JClass<'local>,
ptr: jlong,
) {
let ptr = (ptr as usize) as *mut crate::tor::TorRuntime;
if !ptr.is_null() {
let s = unsafe { Box::from_raw(ptr) };
Expand Down
Loading