Merge pull request #1414 from napi-rs/delete-reference

Delete reference
This commit is contained in:
LongYinan 2022-12-29 15:58:40 +08:00 committed by GitHub
commit 75af3d4253
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 7 deletions

View file

@ -50,7 +50,7 @@ tokio_time = ["tokio/time"]
[dependencies] [dependencies]
ctor = "0.1" ctor = "0.1"
once_cell = "1" once_cell = "1.16"
thread_local = "1" thread_local = "1"
bitflags = "1" bitflags = "1"

View file

@ -598,12 +598,6 @@ extern "C" fn custom_gc(
_context: *mut std::ffi::c_void, _context: *mut std::ffi::c_void,
data: *mut std::ffi::c_void, data: *mut std::ffi::c_void,
) { ) {
let mut ref_count = 0;
check_status_or_throw!(
env,
unsafe { sys::napi_reference_unref(env, data as sys::napi_ref, &mut ref_count) },
"Failed to unref Buffer reference in Custom GC"
);
check_status_or_throw!( check_status_or_throw!(
env, env,
unsafe { sys::napi_delete_reference(env, data as sys::napi_ref) }, unsafe { sys::napi_delete_reference(env, data as sys::napi_ref) },