Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(370)

Unified Diff: fpdfsdk/src/javascript/JS_Runtime.cpp

Issue 1372353002: Leak per-isolate data in pdfium (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/javascript/JS_Runtime.cpp
diff --git a/fpdfsdk/src/javascript/JS_Runtime.cpp b/fpdfsdk/src/javascript/JS_Runtime.cpp
index 1e1486df5c796f6578c07eb71e942b2747c9d32f..7ce8a5343b6a71324fca67d9b90f54c0faee4365 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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698