Commit 1697b20f authored by Jakob Kummerow's avatar Jakob Kummerow Committed by Commit Bot

[inspector-test] Don't leak the ArrayBuffer::Allocator

The creator of the allocator retains ownership and is responsible
for its eventual destruction.

Change-Id: Iaf1b24bee7153b3b1a75df99974adff42c6a197f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1835545
Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64084}
parent 38c90161
......@@ -61,8 +61,9 @@ IsolateData::IsolateData(TaskRunner* task_runner,
: task_runner_(task_runner),
setup_global_tasks_(std::move(setup_global_tasks)) {
v8::Isolate::CreateParams params;
params.array_buffer_allocator =
v8::ArrayBuffer::Allocator::NewDefaultAllocator();
array_buffer_allocator_.reset(
v8::ArrayBuffer::Allocator::NewDefaultAllocator());
params.array_buffer_allocator = array_buffer_allocator_.get();
params.snapshot_blob = startup_data;
params.only_terminate_in_safe_scope = true;
isolate_.reset(v8::Isolate::New(params));
......
......@@ -130,6 +130,7 @@ class IsolateData : public v8_inspector::V8InspectorClient {
TaskRunner* task_runner_;
SetupGlobalTasks setup_global_tasks_;
std::unique_ptr<v8::ArrayBuffer::Allocator> array_buffer_allocator_;
std::unique_ptr<v8::Isolate, IsolateDeleter> isolate_;
std::unique_ptr<v8_inspector::V8Inspector> inspector_;
int last_context_group_id_ = 0;
......
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