fix(napi): napi_adjust_external_memory issue on wini686

This commit is contained in:
LongYinan 2021-03-12 16:09:38 +08:00
parent 0f300da917
commit 1e3290cd01
No known key found for this signature in database
GPG key ID: C3666B7FC82ADAD7

View file

@ -1163,7 +1163,8 @@ unsafe extern "C" fn raw_finalize<T>(
if !finalize_hint.is_null() {
let size_hint = *Box::from_raw(finalize_hint as *mut Option<i64>);
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"