summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaymes Khoury <raymes@chromium.org>2015-09-30 11:46:41 +0200
committerJochen Eisinger <jochen@chromium.org>2015-09-30 11:46:41 +0200
commit3e144b8c23d7c52ed36329e87f0cb01f38ec1ed7 (patch)
tree4ed8ecb304a11f865d4067c792644736d1ab5ccf
parent0fef7dd405ac85660dbeddd2e47620daffa70cb5 (diff)
downloadpdfium-chromium/2524.tar.xz
Leak per-isolate data in pdfiumchromium/2525chromium/2524
Right now we're freeing per-isolate data everytime a document is destroyed even though it may be in use by other documents. For now we leak the per-isolate data until crbug.com/531339 is fixed. BUG=531339 R=jochen@chromium.org Review URL: https://codereview.chromium.org/1372353002 . Patch from Raymes Khoury <raymes@chromium.org>.
-rw-r--r--fpdfsdk/src/javascript/JS_Runtime.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/fpdfsdk/src/javascript/JS_Runtime.cpp b/fpdfsdk/src/javascript/JS_Runtime.cpp
index 1e1486df5c..7ce8a5343b 100644
--- a/fpdfsdk/src/javascript/JS_Runtime.cpp
+++ b/fpdfsdk/src/javascript/JS_Runtime.cpp
@@ -63,7 +63,13 @@ CJS_Runtime::~CJS_Runtime() {
delete m_ContextArray.GetAt(i);
m_ContextArray.RemoveAll();
- FXJS_ReleaseRuntime(GetIsolate(), m_context);
+
+ // TODO(raymes): Currently we're freeing per-isolate data everytime a
+ // document is destroyed even though it may be in use by other documents. For
+ // now we leak the per-isolate data (when m_isolateManaged is false) until
+ // crbug.com/531339 is fixed.
+ if (m_isolateManaged)
+ FXJS_ReleaseRuntime(GetIsolate(), m_context);
m_pApp = NULL;
m_pDocument = NULL;