Skip to content

Commit

Permalink
src: delete CallbackInfo when cleared from cleanup hook
Browse files Browse the repository at this point in the history
Fixes: #32400

PR-URL: #32405
Reviewed-By: Matheus Marchini <[email protected]>
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
addaleax authored and targos committed Apr 22, 2020
1 parent 97e352d commit 7aa2ee2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/node_buffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,14 @@ void CallbackInfo::WeakCallback(
const WeakCallbackInfo<CallbackInfo>& data) {
CallbackInfo* self = data.GetParameter();
self->WeakCallback(data.GetIsolate());
delete self;
}


void CallbackInfo::WeakCallback(Isolate* isolate) {
callback_(data_, hint_);
int64_t change_in_bytes = -static_cast<int64_t>(sizeof(*this));
isolate->AdjustAmountOfExternalAllocatedMemory(change_in_bytes);
delete this;
}


Expand Down

0 comments on commit 7aa2ee2

Please sign in to comment.