mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
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>
This commit is contained in:
1 parent
f2cc28aec3
commit
678e1be6aa
1 file changed
+1
-1
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user