summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/javascript
diff options
context:
space:
mode:
authorJochen Eisinger <jochen@chromium.org>2015-08-05 08:55:39 +0200
committerJochen Eisinger <jochen@chromium.org>2015-08-05 08:55:39 +0200
commit7ea305f1bd4efc1838fba053e4399358d6765ec7 (patch)
tree8d3e952fcfa3880dedcfc2064f12fb7c342fd059 /fpdfsdk/src/javascript
parent7f6b084fbdde785240f2509ae3617a17937f97ba (diff)
downloadpdfium-7ea305f1bd4efc1838fba053e4399358d6765ec7.tar.xz
Don't dispose the isolate if its provided by the embedderchromium/2474
BUG=chromium:515718 R=thestig@chromium.org Review URL: https://codereview.chromium.org/1269783005 .
Diffstat (limited to 'fpdfsdk/src/javascript')
-rw-r--r--fpdfsdk/src/javascript/JS_Runtime.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/fpdfsdk/src/javascript/JS_Runtime.cpp b/fpdfsdk/src/javascript/JS_Runtime.cpp
index 08cd87c768..4ef34a8d20 100644
--- a/fpdfsdk/src/javascript/JS_Runtime.cpp
+++ b/fpdfsdk/src/javascript/JS_Runtime.cpp
@@ -98,7 +98,8 @@ CJS_Runtime::CJS_Runtime(CPDFDoc_Environment* pApp)
m_pDocument(NULL),
m_bBlocking(FALSE),
m_pFieldEventPath(NULL),
- m_isolate(NULL) {
+ m_isolate(NULL),
+ m_isolateManaged(false) {
if (m_pApp->GetFormFillInfo()->m_pJsPlatform->version >= 2) {
m_isolate = reinterpret_cast<v8::Isolate*>(
m_pApp->GetFormFillInfo()->m_pJsPlatform->m_isolate);
@@ -109,6 +110,7 @@ CJS_Runtime::CJS_Runtime(CPDFDoc_Environment* pApp)
v8::Isolate::CreateParams params;
params.array_buffer_allocator = m_pArrayBufferAllocator.get();
m_isolate = v8::Isolate::New(params);
+ m_isolateManaged = true;
}
InitJSObjects();
@@ -133,8 +135,8 @@ CJS_Runtime::~CJS_Runtime() {
m_pFieldEventPath = NULL;
m_context.Reset();
- // m_isolate->Exit();
- m_isolate->Dispose();
+ if (m_isolateManaged)
+ m_isolate->Dispose();
}
FX_BOOL CJS_Runtime::InitJSObjects() {