Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2020-03-21 12:08:08 +0300
committerMatheus Marchini <mmarchini@netflix.com>2020-03-23 21:02:04 +0300
commit678e1be6aa145b99397342bb4a00440ba4bf4999 (patch)
tree71e5894b4e067ff2a926bb313e70c1d5cbe40871 /src/node_buffer.cc
parentf2cc28aec3e7e938d070f04466055509961d7acb (diff)
src: delete CallbackInfo when cleared from cleanup hook
Fixes: https://github.com/nodejs/node/issues/32400 PR-URL: https://github.com/nodejs/node/pull/32405 Reviewed-By: Matheus Marchini <mat@mmarchini.me> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node_buffer.cc')
-rw-r--r--src/node_buffer.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/node_buffer.cc b/src/node_buffer.cc
index a2e6ec27f82..77120d6af4a 100644
--- a/src/node_buffer.cc
+++ b/src/node_buffer.cc
@@ -163,7 +163,6 @@ void CallbackInfo::WeakCallback(
const WeakCallbackInfo<CallbackInfo>& data) {
CallbackInfo* self = data.GetParameter();
self->WeakCallback(data.GetIsolate());
- delete self;
}
@@ -171,6 +170,7 @@ 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;
}