Index: xfa/src/fxjse/src/runtime.cpp |
diff --git a/xfa/src/fxjse/src/runtime.cpp b/xfa/src/fxjse/src/runtime.cpp |
index 5609c35b6364fe30a3001061c679f47aaecc2d83..124da8ed43ad5c8200378afff1b7e03f22f98bc6 100644 |
--- a/xfa/src/fxjse/src/runtime.cpp |
+++ b/xfa/src/fxjse/src/runtime.cpp |
@@ -58,12 +58,20 @@ FXJSE_HRUNTIME FXJSE_Runtime_Create() { |
CFXJSE_RuntimeData::g_RuntimeList->AppendRuntime(pIsolate); |
return reinterpret_cast<FXJSE_HRUNTIME>(pIsolate); |
} |
-void FXJSE_Runtime_Release(FXJSE_HRUNTIME hRuntime) { |
+void FXJSE_Runtime_Release(FXJSE_HRUNTIME hRuntime, bool bOwnedRuntime) { |
v8::Isolate* pIsolate = reinterpret_cast<v8::Isolate*>(hRuntime); |
- if (pIsolate) { |
+ if (!pIsolate) |
+ return; |
+ if (bOwnedRuntime) { |
ASSERT(CFXJSE_RuntimeData::g_RuntimeList); |
CFXJSE_RuntimeData::g_RuntimeList->RemoveRuntime( |
pIsolate, FXJSE_Runtime_DisposeCallback); |
+ } else { |
+ v8::Locker locker(pIsolate); |
jochen (gone - plz use gerrit)
2016/02/01 12:06:37
don't use v8::Locker
Jim Wang
2016/02/02 03:46:36
Done.
|
+ if (FXJS_PerIsolateData* pData = FXJS_PerIsolateData::Get(pIsolate)) { |
+ delete pData->m_pFXJSERuntimeData; |
+ pData->m_pFXJSERuntimeData = nullptr; |
+ } |
} |
} |
CFXJSE_RuntimeData* CFXJSE_RuntimeData::Create(v8::Isolate* pIsolate) { |