fix(napi): should also delete the reference while dropping the Buffer

This commit is contained in:
LongYinan 2022-10-02 09:38:11 +08:00
parent 4279291f4b
commit 47de6301ee
No known key found for this signature in database
GPG key ID: C3666B7FC82ADAD7
6 changed files with 53 additions and 36 deletions
examples/napi/src

View file

@ -68,8 +68,6 @@ impl Task for AsyncBuffer {
}
#[napi]
fn async_reduce_buffer(mut buf: Buffer, env: Env) -> Result<AsyncTask<AsyncBuffer>> {
Ok(AsyncTask::new(AsyncBuffer {
buf: buf.clone(&env)?,
}))
fn async_reduce_buffer(buf: Buffer) -> Result<AsyncTask<AsyncBuffer>> {
Ok(AsyncTask::new(AsyncBuffer { buf: buf.clone() }))
}