n-api: fix memory leak in napi_async_destroy()
PR-URL: https://github.com/nodejs/node/pull/17714 Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
400e73a9d0
commit
94e29510d9
@ -2770,6 +2770,8 @@ napi_status napi_async_destroy(napi_env env,
|
|||||||
reinterpret_cast<node::async_context*>(async_context);
|
reinterpret_cast<node::async_context*>(async_context);
|
||||||
node::EmitAsyncDestroy(isolate, *node_async_context);
|
node::EmitAsyncDestroy(isolate, *node_async_context);
|
||||||
|
|
||||||
|
delete node_async_context;
|
||||||
|
|
||||||
return napi_clear_last_error(env);
|
return napi_clear_last_error(env);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user