diff --git a/tools/code_cache/mkcodecache.cc b/tools/code_cache/mkcodecache.cc index 34af7bc61ba374..fabb6a1a5d2f4d 100644 --- a/tools/code_cache/mkcodecache.cc +++ b/tools/code_cache/mkcodecache.cc @@ -49,8 +49,9 @@ int main(int argc, char* argv[]) { // Create a new Isolate and make it the current one. Isolate::CreateParams create_params; - create_params.array_buffer_allocator = - ArrayBuffer::Allocator::NewDefaultAllocator(); + std::unique_ptr array_buffer_allocator { + ArrayBuffer::Allocator::NewDefaultAllocator() }; + create_params.array_buffer_allocator = array_buffer_allocator.get(); Isolate* isolate = Isolate::New(create_params); { Isolate::Scope isolate_scope(isolate); @@ -65,6 +66,7 @@ int main(int argc, char* argv[]) { out << cache; out.close(); } + isolate->Dispose(); v8::V8::ShutdownPlatform(); return 0;