From 6a3d43ad0edf14bde2075c026a806c3ccd0d6ee3 Mon Sep 17 00:00:00 2001 From: Nasr Date: Wed, 4 Dec 2024 15:14:29 +0700 Subject: [PATCH] fix: fix other subscriptions that use arc raw --- src/c/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/c/mod.rs b/src/c/mod.rs index 9fc706d..8830c02 100644 --- a/src/c/mod.rs +++ b/src/c/mod.rs @@ -312,7 +312,7 @@ pub unsafe extern "C" fn client_on_starknet_event( clauses_len: usize, callback: unsafe extern "C" fn(Event), ) -> Result<*mut Subscription> { - let client = Arc::from_raw(client); + let client = Arc::new(unsafe { &*client }); let clauses = unsafe { std::slice::from_raw_parts(clauses, clauses_len) }; let clauses = clauses.iter().map(|c| c.into()).collect::>(); @@ -411,7 +411,7 @@ pub unsafe extern "C" fn on_indexer_update( contract_address: *const types::FieldElement, callback: unsafe extern "C" fn(IndexerUpdate), ) -> Result<*mut Subscription> { - let client = Arc::from_raw(client); + let client = Arc::new(unsafe { &*client }); let contract_address = if contract_address.is_null() { None } else {