Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e61337d

Browse filesBrowse files
mhdawsonaddaleax
authored andcommitted
async_wrap: fix memory leak in AsyncResource
Reset the persistent that keeps the resource Object alive when the AsyncResource is being destroyed. Fixes: nodejs/node-addon-api#237 PR-URL: #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>
1 parent 2a7c863 commit e61337d
Copy full SHA for e61337d

File tree

Expand file treeCollapse file tree

1 file changed

+1
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-0
lines changed
Open diff view settings
Collapse file

‎src/node.h‎

Copy file name to clipboardExpand all lines: src/node.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,7 @@ class AsyncResource {
714714

715715
virtual ~AsyncResource() {
716716
EmitAsyncDestroy(isolate_, async_context_);
717+
resource_.Reset();
717718
}
718719

719720
v8::MaybeLocal<v8::Value> MakeCallback(

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.