summaryrefslogtreecommitdiff
path: root/src/node_object_wrap.h
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2010-10-04 12:52:46 -0700
committerRyan Dahl <ry@tinyclouds.org>2010-10-04 12:52:46 -0700
commitdbf0d6bb70902fba80b10adccf3f54fe9cf5beb7 (patch)
treefff2d7deaea14fd59f3080a4040c9267694d38c2 /src/node_object_wrap.h
parent8ff7954165205b2f3ade222d717ac62edb502932 (diff)
downloadandroid-node-v8-dbf0d6bb70902fba80b10adccf3f54fe9cf5beb7.tar.gz
android-node-v8-dbf0d6bb70902fba80b10adccf3f54fe9cf5beb7.tar.bz2
android-node-v8-dbf0d6bb70902fba80b10adccf3f54fe9cf5beb7.zip
ClearWeak on ObjectWraps. I /think/ this is the correct semantics
Diffstat (limited to 'src/node_object_wrap.h')
-rw-r--r--src/node_object_wrap.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/node_object_wrap.h b/src/node_object_wrap.h
index 8eafd891cf..fba40fb2c6 100644
--- a/src/node_object_wrap.h
+++ b/src/node_object_wrap.h
@@ -16,6 +16,7 @@ class ObjectWrap {
virtual ~ObjectWrap ( ) {
if (!handle_.IsEmpty()) {
assert(handle_.IsNearDeath());
+ handle_.ClearWeak();
handle_->SetInternalField(0, v8::Undefined());
handle_.Dispose();
handle_.Clear();
@@ -82,7 +83,8 @@ class ObjectWrap {
ObjectWrap *obj = static_cast<ObjectWrap*>(data);
assert(value == obj->handle_);
assert(!obj->refs_);
- if (value.IsNearDeath()) delete obj;
+ assert(value.IsNearDeath());
+ delete obj;
}
};