summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fpdfxfa/fpdfxfa_app.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/src/fpdfxfa/fpdfxfa_app.cpp')
-rw-r--r--fpdfsdk/src/fpdfxfa/fpdfxfa_app.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/fpdfsdk/src/fpdfxfa/fpdfxfa_app.cpp b/fpdfsdk/src/fpdfxfa/fpdfxfa_app.cpp
index 44e9c72ddc..1006bf9c44 100644
--- a/fpdfsdk/src/fpdfxfa/fpdfxfa_app.cpp
+++ b/fpdfsdk/src/fpdfxfa/fpdfxfa_app.cpp
@@ -31,7 +31,8 @@ CPDFXFA_App::CPDFXFA_App()
m_pXFAApp(NULL),
m_pFontMgr(NULL),
m_hJSERuntime(NULL),
- m_csAppType(JS_STR_VIEWERTYPE_STANDARD) {
+ m_csAppType(JS_STR_VIEWERTYPE_STANDARD),
+ m_bOwnedRuntime(false) {
m_pEnvList.RemoveAll();
}
@@ -43,7 +44,7 @@ CPDFXFA_App::~CPDFXFA_App() {
m_pXFAApp = NULL;
#ifdef PDF_ENABLE_XFA
- FXJSE_Runtime_Release(m_hJSERuntime);
+ FXJSE_Runtime_Release(m_hJSERuntime, m_bOwnedRuntime);
m_hJSERuntime = NULL;
FXJSE_Finalize();
@@ -51,12 +52,13 @@ CPDFXFA_App::~CPDFXFA_App() {
#endif
}
-FX_BOOL CPDFXFA_App::Initialize() {
+FX_BOOL CPDFXFA_App::Initialize(FXJSE_HRUNTIME hRuntime) {
#ifdef PDF_ENABLE_XFA
BC_Library_Init();
FXJSE_Initialize();
- m_hJSERuntime = FXJSE_Runtime_Create();
+ m_bOwnedRuntime = !hRuntime;
+ m_hJSERuntime = hRuntime ? hRuntime : FXJSE_Runtime_Create();
if (!m_hJSERuntime)
return FALSE;