8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 23525b0 commit ce7fad5Copy full SHA for ce7fad5
src/base_object-inl.h
@@ -95,13 +95,12 @@ void BaseObject::MakeWeak() {
95
persistent_handle_.SetWeak(
96
this,
97
[](const v8::WeakCallbackInfo<BaseObject>& data) {
98
- BaseObject* obj = data.GetParameter();
+ std::unique_ptr<BaseObject> obj(data.GetParameter());
99
// Clear the persistent handle so that ~BaseObject() doesn't attempt
100
// to mess with internal fields, since the JS object may have
101
// transitioned into an invalid state.
102
// Refs: https://github.com/nodejs/node/issues/18897
103
obj->persistent_handle_.Reset();
104
- delete obj;
105
}, v8::WeakCallbackType::kParameter);
106
}
107
0 commit comments