Skip to content

Commit

Permalink
Allow ObjectWrap destructors before Wrap()
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Jun 4, 2010
1 parent 9e8df0e commit 935f843
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/node_object_wrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ class ObjectWrap {
}

virtual ~ObjectWrap ( ) {
handle_->SetInternalField(0, v8::Undefined());
handle_.Dispose();
handle_.Clear();
if (!handle_.IsEmpty()) {
assert(handle_.IsNearDeath());
handle_->SetInternalField(0, v8::Undefined());
handle_.Dispose();
handle_.Clear();
}
}

template <class T>
Expand Down

0 comments on commit 935f843

Please sign in to comment.