src: fix handle leak in Parser::Execute()

Fix a resource leak where an intermediate Local<Context> handle in
Environment::GetCurrent() got leaked into whatever HandleScope was
further up the stack.

Reviewed-by: Trevor Norris <trev.norris@gmail.com>
pull/23396/head
Ben Noordhuis 2014-08-22 23:57:46 +02:00 committed by Trevor Norris
parent 176f0bd3df
commit de9a444ab4
1 changed files with 1 additions and 1 deletions

View File

@ -373,8 +373,8 @@ class Parser : public BaseObject {
// var bytesParsed = parser->execute(buffer);
static void Execute(const FunctionCallbackInfo<Value>& args) {
HandleScope handle_scope(args.GetIsolate());
Environment* env = Environment::GetCurrent(args.GetIsolate());
HandleScope scope(env->isolate());
Parser* parser = Unwrap<Parser>(args.Holder());
assert(parser->current_buffer_.IsEmpty());