Skip to content

Commit

Permalink
fixup! src: call napi_remove_wrap() in ObjectWrap dtor
Browse files Browse the repository at this point in the history
  • Loading branch information
addaleax committed Jan 14, 2020
1 parent 7172a0a commit 955ff7c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions napi-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -3147,8 +3147,11 @@ inline ObjectWrap<T>::ObjectWrap(const Napi::CallbackInfo& callbackInfo) {

template <typename T>
inline ObjectWrap<T>::~ObjectWrap() {
if (!IsEmpty())
napi_remove_wrap(Env(), Value(), nullptr);
if (!IsEmpty()) {
Object object = Value();
if (!object.IsEmpty())
napi_remove_wrap(Env(), object, nullptr);
}
}

template<typename T>
Expand Down

0 comments on commit 955ff7c

Please sign in to comment.