From 1e3290cd01db78970b07598f2efba7eaf6a2e569 Mon Sep 17 00:00:00 2001 From: LongYinan Date: Fri, 12 Mar 2021 16:09:38 +0800 Subject: [PATCH] fix(napi): napi_adjust_external_memory issue on wini686 --- napi/src/env.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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"