mirror of
https://github.com/logos-messaging/logos-messaging-rust-bindings.git
synced 2026-01-03 22:43:07 +00:00
avoid closure to be dropped in release mode (#116)
This commit is contained in:
parent
9c9900897e
commit
1d95d05dd7
@ -52,9 +52,9 @@ macro_rules! handle_ffi_call {
|
||||
notify_clone.notify_one();
|
||||
};
|
||||
|
||||
let mut closure = result_cb;
|
||||
// Create trampoline and invoke the `waku_sys` function
|
||||
let code = unsafe {
|
||||
let mut closure = result_cb;
|
||||
let cb = get_trampoline(&closure);
|
||||
$waku_fn(
|
||||
$ctx, // Pass the context
|
||||
|
||||
@ -33,8 +33,8 @@ pub async fn waku_new(config: Option<WakuNodeConfig>) -> Result<WakuNodeContext>
|
||||
result = r;
|
||||
notify_clone.notify_one(); // Notify that the value has been updated
|
||||
};
|
||||
let mut closure = result_cb;
|
||||
let obj_ptr = unsafe {
|
||||
let mut closure = result_cb;
|
||||
let cb = get_trampoline(&closure);
|
||||
waku_sys::waku_new(config_ptr, cb, &mut closure as *mut _ as *mut c_void)
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user