From da11a11987b6a99af3062659e65f0d86f48e482a Mon Sep 17 00:00:00 2001 From: Charles Lowell Date: Wed, 20 Jun 2012 13:06:02 -0500 Subject: [PATCH] hold a reference to the Ruby object When we have a JS object that proxies a Ruby object, store a hard reference to the Ruby object so that it cannot be garbage collected as long as a reference is being held from within JavaScript. --- lib/v8/conversion/class.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/v8/conversion/class.rb b/lib/v8/conversion/class.rb index 3032571..030e996 100644 --- a/lib/v8/conversion/class.rb +++ b/lib/v8/conversion/class.rb @@ -40,7 +40,9 @@ class V8::Conversion end def link - context.link self[0].Value(), This() + external = self[0] + This().SetHiddenValue("rr::implementation", external) + context.link external.Value(), This() end def construct(cls)