From 54be7be992f1cde40b9d5c0e55a119c6cc4e4e02 Mon Sep 17 00:00:00 2001 From: weili Date: Wed, 21 Sep 2016 10:19:50 -0700 Subject: Fix leaks related to the usage of JSE runtime data Per isolate runtime data should be deleted when the associated isolate's destructed. Also, the internal of per isolate runtime data is obscure to the JS engine. So XFA or this class itself has to be in charge of the memory management. Use smart pointer for it so that the resource could be released properly. BUG=pdfium:242 Review-Url: https://codereview.chromium.org/2354923003 --- fxjs/fxjs_v8.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'fxjs/fxjs_v8.cpp') diff --git a/fxjs/fxjs_v8.cpp b/fxjs/fxjs_v8.cpp index 53f2527ad6..5304254242 100644 --- a/fxjs/fxjs_v8.cpp +++ b/fxjs/fxjs_v8.cpp @@ -215,12 +215,7 @@ FXJS_PerIsolateData* FXJS_PerIsolateData::Get(v8::Isolate* pIsolate) { pIsolate->GetData(g_embedderDataSlot)); } -#ifndef PDF_ENABLE_XFA FXJS_PerIsolateData::FXJS_PerIsolateData() : m_pDynamicObjsMap(nullptr) {} -#else // PDF_ENABLE_XFA -FXJS_PerIsolateData::FXJS_PerIsolateData() - : m_pFXJSERuntimeData(nullptr), m_pDynamicObjsMap(nullptr) {} -#endif // PDF_ENABLE_XFA CFXJS_Engine::CFXJS_Engine() : m_isolate(nullptr) {} -- cgit v1.2.3