}
virtual ~ObjectWrap ( ) {
- if (!handle_.IsEmpty()) {
- assert(handle_.IsNearDeath());
- handle_->SetInternalField(0, v8::Undefined());
- handle_.Dispose();
- handle_.Clear();
- }
+ assert(handle_.IsNearDeath());
+ handle_->SetInternalField(0, v8::Undefined());
+ handle_.Dispose();
+ handle_.Clear();
}
protected:
assert(handle->InternalFieldCount() > 0);
handle_ = v8::Persistent<v8::Object>::New(handle);
handle_->SetInternalField(0, v8::External::New(this));
- MakeWeak();
- }
-
- inline void MakeWeak (void)
- {
handle_.MakeWeak(this, WeakCallback);
}
assert(!handle_.IsEmpty());
assert(handle_.IsWeak());
refs_++;
- MakeWeak();
}
/* Unref() marks an object as detached from the event loop. This is its
assert(value == obj->handle_);
if (obj->refs_ == 0) {
delete obj;
- } else {
- obj->MakeWeak();
}
}
};