Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Unified Diff: fxjs/cfxjse_runtimedata.cpp

Issue 2254123004: Fix leaked array buffer allocators of isolates (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: address comment Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fxjs/cfxjse_isolatetracker.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fxjs/cfxjse_runtimedata.cpp
diff --git a/fxjs/cfxjse_runtimedata.cpp b/fxjs/cfxjse_runtimedata.cpp
index b203cb71ac6fcfbbe20f40952a42339878681f6d..2c9379526e40c2e044b0864907142dd71f24e516 100644
--- a/fxjs/cfxjse_runtimedata.cpp
+++ b/fxjs/cfxjse_runtimedata.cpp
@@ -56,11 +56,13 @@ void FXJSE_Finalize() {
}
v8::Isolate* FXJSE_Runtime_Create_Own() {
+ std::unique_ptr<v8::ArrayBuffer::Allocator> allocator(
+ new FXJSE_ArrayBufferAllocator());
v8::Isolate::CreateParams params;
- params.array_buffer_allocator = new FXJSE_ArrayBufferAllocator();
+ params.array_buffer_allocator = allocator.get();
v8::Isolate* pIsolate = v8::Isolate::New(params);
ASSERT(pIsolate && CFXJSE_IsolateTracker::g_pInstance);
- CFXJSE_IsolateTracker::g_pInstance->Append(pIsolate);
+ CFXJSE_IsolateTracker::g_pInstance->Append(pIsolate, std::move(allocator));
return pIsolate;
}
« no previous file with comments | « fxjs/cfxjse_isolatetracker.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698