Skip to content

Commit

Permalink
Merge pull request #68 from dojoengine/fix-other-subs
Browse files Browse the repository at this point in the history
fix: fix other subscriptions that use arc raw
  • Loading branch information
Larkooo authored Dec 4, 2024
2 parents 018f4c3 + 6a3d43a commit 2983dea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/c/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<Vec<_>>();

Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 2983dea

Please sign in to comment.