Commit 5c4aae39 authored by ishell's avatar ishell Committed by Commit bot

Global handle leak in Realm.create() fixed.

BUG=chromium:501808
LOG=N

Review URL: https://codereview.chromium.org/1197403002

Cr-Commit-Position: refs/heads/master@{#29224}
parent deb5dcea
......@@ -496,6 +496,7 @@ void Shell::RealmCreate(const v8::FunctionCallbackInfo<v8::Value>& args) {
data->realms_ = new Persistent<Context>[++data->realm_count_];
for (int i = 0; i < index; ++i) {
data->realms_[i].Reset(isolate, old_realms[i]);
old_realms[i].Reset();
}
delete[] old_realms;
Handle<ObjectTemplate> global_template = CreateGlobalTemplate(isolate);
......
// Copyright 2015 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
var r = Realm.create();
assertEquals(0, "a".localeCompare("a"));
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment