mirror of
https://github.com/nodejs/node.git
synced 2026-11-29 14:27:57 -05:00
async_wrap: fix memory leak in AsyncResource
Reset the persistent that keeps the resource Object alive when the AsyncResource is being destroyed. Fixes: https://github.com/nodejs/node-addon-api/issues/237 PR-URL: https://github.com/nodejs/node/pull/20668 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
1 parent
2a7c863d3d
commit
e61337d36d
1 file changed
+1
@@ -714,6 +714,7 @@ class AsyncResource {
|
||||
|
||||
virtual ~AsyncResource() {
|
||||
EmitAsyncDestroy(isolate_, async_context_);
|
||||
resource_.Reset();
|
||||
}
|
||||
|
||||
v8::MaybeLocal<v8::Value> MakeCallback(
|
||||
|
||||
Reference in new issue
Block a user