Index: gin/wrappable.cc |
diff --git a/gin/wrappable.cc b/gin/wrappable.cc |
index 5c7c629b7e4e50fd264255db70269af4ab82c582..cb652d6cbdc4480c132408f06a3d58bd10350dc7 100644 |
--- a/gin/wrappable.cc |
+++ b/gin/wrappable.cc |
@@ -26,7 +26,7 @@ void Wrappable::WeakCallback( |
const v8::WeakCallbackData<v8::Object, Wrappable>& data) { |
Wrappable* wrappable = data.GetParameter(); |
wrappable->wrapper_.Reset(); |
- wrappable->Release(); // Balanced in Wrappable::ConfigureWrapper. |
+ delete wrappable; |
} |
v8::Handle<v8::Object> Wrappable::CreateWrapper(v8::Isolate* isolate) { |
@@ -39,7 +39,6 @@ v8::Handle<v8::Object> Wrappable::CreateWrapper(v8::Isolate* isolate) { |
wrapper->SetAlignedPointerInInternalField(kWrapperInfoIndex, info); |
wrapper->SetAlignedPointerInInternalField(kEncodedValueIndex, this); |
wrapper_.Reset(isolate, wrapper); |
- AddRef(); // Balanced in Wrappable::WeakCallback. |
wrapper_.SetWeak(this, WeakCallback); |
return wrapper; |
} |