diff options
author | Tom Sepez <tsepez@chromium.org> | 2016-03-24 09:19:20 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2016-03-24 09:19:20 -0700 |
commit | 129a60ec2d4d98ed953beaca629c99a52fb7e9b0 (patch) | |
tree | 7abcff1d0a8edafba5eee4705a24c164e58584bd /fpdfsdk/jsapi/fxjs_v8.cpp | |
parent | e432675850161570a8562f8c617da039f51f706d (diff) | |
download | pdfium-129a60ec2d4d98ed953beaca629c99a52fb7e9b0.tar.xz |
Revert "Preserve m_pDynamicObjsMap until FXJS_PerIsolateData is destroyed."
This reverts commit e432675850161570a8562f8c617da039f51f706d.
Reson for revert - broke tests.
TBR=jochen@chromium.org
Review URL: https://codereview.chromium.org/1826223002 .
Diffstat (limited to 'fpdfsdk/jsapi/fxjs_v8.cpp')
-rw-r--r-- | fpdfsdk/jsapi/fxjs_v8.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/fpdfsdk/jsapi/fxjs_v8.cpp b/fpdfsdk/jsapi/fxjs_v8.cpp index adbdeb12e6..473b546318 100644 --- a/fpdfsdk/jsapi/fxjs_v8.cpp +++ b/fpdfsdk/jsapi/fxjs_v8.cpp @@ -371,6 +371,11 @@ void FXJS_ReleaseRuntime(v8::Isolate* pIsolate, v8::Local<v8::Context>::New(pIsolate, *pV8PersistentContext); v8::Context::Scope context_scope(context); + FXJS_PerIsolateData* pData = FXJS_PerIsolateData::Get(pIsolate); + if (!pData) + return; + pData->ReleaseDynamicObjsMap(); + int maxID = CFXJS_ObjDefinition::MaxID(pIsolate); for (int i = 0; i < maxID; ++i) { CFXJS_ObjDefinition* pObjDef = CFXJS_ObjDefinition::ForID(pIsolate, i); @@ -397,12 +402,8 @@ void FXJS_ReleaseRuntime(v8::Isolate* pIsolate, for (int i = 0; i < maxID; ++i) delete CFXJS_ObjDefinition::ForID(pIsolate, i); - FXJS_PerIsolateData* pData = FXJS_PerIsolateData::Get(pIsolate); - if (pData) { - pData->ReleaseDynamicObjsMap(); - pIsolate->SetData(g_embedderDataSlot, nullptr); - delete pData; - } + pIsolate->SetData(g_embedderDataSlot, nullptr); + delete pData; } IJS_Runtime* FXJS_GetRuntimeFromIsolate(v8::Isolate* pIsolate) { |