diff --git a/src/lib.rs b/src/lib.rs index 2ccc19b..400e227 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -436,7 +436,8 @@ pub unsafe extern "C" fn account_execute_raw( pub unsafe extern "C" fn client_free(t: *mut ToriiClient) { if !t.is_null() { unsafe { - let _ = Box::from_raw(t); + let client = Box::from_raw(t); + client.runtime.shutdown_background(); } } }