Skip to content

Commit

Permalink
fix(android): remove unnecessary v8 refs (#11931)
Browse files Browse the repository at this point in the history
  • Loading branch information
garymathews committed Aug 21, 2020
1 parent aea22bf commit 4122858
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions android/runtime/v8/src/native/NativeObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ class NativeObject


virtual ~NativeObject() {
if (persistent().IsEmpty())
if (persistent().IsEmpty()) {
return;
assert(persistent().IsNearDeath());
}
persistent().ClearWeak();
persistent().Reset();
}
Expand Down Expand Up @@ -117,14 +117,13 @@ class NativeObject
static void WeakCallback(const v8::WeakCallbackInfo<NativeObject>& data) {
NativeObject* wrap = data.GetParameter();
assert(wrap->refs_ == 0);
assert(wrap->handle_.IsNearDeath());
wrap->handle_.Reset();
delete wrap;
}

v8::Persistent<v8::Object> handle_;

friend class ProxyFactory;
friend class ProxyFactory;
};

}
Expand Down

0 comments on commit 4122858

Please sign in to comment.