From 7d4c74d1b96d82681d49519c129262a1568e87d4 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 10 Nov 2015 15:07:08 -0800 Subject: Keep "static" objects per-context rather than per isolate. Every time we initialize a new v8::Context, we make a new set of pre-existing native objects, and overwrite the v8::Global handles to those in the previous set. Thus, we may be theoretically releasing some v8::Globals early. R=jochen@chromium.org Review URL: https://codereview.chromium.org/1424933013 . --- fpdfsdk/src/javascript/JS_Runtime.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'fpdfsdk/src/javascript/JS_Runtime.cpp') diff --git a/fpdfsdk/src/javascript/JS_Runtime.cpp b/fpdfsdk/src/javascript/JS_Runtime.cpp index 34a18dc385..74d9a44a1c 100644 --- a/fpdfsdk/src/javascript/JS_Runtime.cpp +++ b/fpdfsdk/src/javascript/JS_Runtime.cpp @@ -64,7 +64,7 @@ CJS_Runtime::CJS_Runtime(CPDFDoc_Environment* pApp) DefineJSObjects(); CJS_Context* pContext = (CJS_Context*)NewContext(); - FXJS_InitializeRuntime(GetIsolate(), this, m_context); + FXJS_InitializeRuntime(GetIsolate(), this, &m_context, &m_StaticObjects); ReleaseContext(pContext); } @@ -76,7 +76,7 @@ CJS_Runtime::~CJS_Runtime() { delete m_ContextArray.GetAt(i); m_ContextArray.RemoveAll(); - FXJS_ReleaseRuntime(GetIsolate(), m_context); + FXJS_ReleaseRuntime(GetIsolate(), &m_context, &m_StaticObjects); m_pApp = NULL; m_pDocument = NULL; -- cgit v1.2.3