summaryrefslogtreecommitdiff
path: root/fxjs/cfxjse_runtimedata.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fxjs/cfxjse_runtimedata.cpp')
-rw-r--r--fxjs/cfxjse_runtimedata.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/fxjs/cfxjse_runtimedata.cpp b/fxjs/cfxjse_runtimedata.cpp
index b203cb71ac..2c9379526e 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;
}