From 98b356a36bc9291a4f222d092afeeea0d5b5f379 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Mon, 16 Jul 2018 21:35:06 +0000 Subject: Use UnownedPtr<> to v8::Isolates. Isolates are long-lived, but this may catch a few things. Introduce CFX_V8IsolateDeleter for unique_ptr usage. Fix Dispose()/SetIsolate(nullptr) ordering in cjs_runtime.cpp Remove one unused isolate member. Flip protected -> private in one place. Change-Id: I26cdd120f799192e93b0d9d04dcde8f348dc21f3 Reviewed-on: https://pdfium-review.googlesource.com/37931 Reviewed-by: Lei Zhang Commit-Queue: Tom Sepez --- fxjs/cjs_runtime.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'fxjs/cjs_runtime.cpp') diff --git a/fxjs/cjs_runtime.cpp b/fxjs/cjs_runtime.cpp index 96253c08bf..634c48be74 100644 --- a/fxjs/cjs_runtime.cpp +++ b/fxjs/cjs_runtime.cpp @@ -81,10 +81,8 @@ CJS_Runtime::CJS_Runtime(CPDFSDK_FormFillEnvironment* pFormFillEnv) CJS_Runtime::~CJS_Runtime() { NotifyObservers(); ReleaseEngine(); - if (m_isolateManaged) { - GetIsolate()->Dispose(); - SetIsolate(nullptr); - } + if (m_isolateManaged) + DisposeIsolate(); } void CJS_Runtime::DefineJSObjects() { -- cgit v1.2.3