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:
parent
5737292a86
commit
2b352a27e4
1 changed files with 4 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue