diff --git a/napi/src/env.rs b/napi/src/env.rs index e39fff6f..7ea54ff1 100644 --- a/napi/src/env.rs +++ b/napi/src/env.rs @@ -1163,7 +1163,8 @@ unsafe extern "C" fn raw_finalize( if !finalize_hint.is_null() { let size_hint = *Box::from_raw(finalize_hint as *mut Option); if let Some(changed) = size_hint { - let status = sys::napi_adjust_external_memory(env, -changed, ptr::null_mut()); + let mut adjusted = 0i64; + let status = sys::napi_adjust_external_memory(env, -changed, &mut adjusted); debug_assert!( status == sys::Status::napi_ok, "Calling napi_adjust_external_memory failed"