1
0
Fork 0
mirror of https://github.com/rubyjs/therubyracer synced 2023-03-27 23:21:42 -04:00

dispose of temporary context

This commit is contained in:
Charles Lowell 2010-05-18 15:43:03 +03:00
parent 5737292a86
commit 2b352a27e4

View file

@ -23,7 +23,10 @@ namespace {
VALUE scope;
rb_scan_args(argc,argv, "01", &scope);
if (NIL_P(scope)) {
return V8_Ref_Create(self, Context::New());
Persistent<Context> cxt(Context::New());
VALUE ref = V8_Ref_Create(self, cxt);
cxt.Dispose();
return ref;
} else {
Persistent<Context> context = Context::New(0, Racer_Create_V8_ObjectTemplate(scope));
Context::Scope enter(context);