ext/h8/ruby_gate.h in h8-0.4.11 vs ext/h8/ruby_gate.h in h8-0.5.0

- old
+ new

@@ -40,21 +40,26 @@ rb_gc_mark(ruby_object); } virtual void free() { // printf("RG::FREE(%p)\n", this); - delete this; + context->unregister_ruby_gate(this); + context = 0; +// delete this; } VALUE rubyObject() const { return ruby_object; } virtual ~RubyGate() { // puts("~RG()"); - context->unregister_ruby_gate(this); - persistent().ClearWeak(); - persistent().Reset(); + if( context ) { +// puts("rg2"); + context->unregister_ruby_gate(this); + } +// persistent().ClearWeak(); +// persistent().Reset(); // The rest is done by the base classes } Isolate* isolate() const noexcept { return context->getIsolate();