summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fpdfxfa
diff options
context:
space:
mode:
authorJun Fang <jun_fang@foxitsoftware.com>2016-02-04 17:47:00 -0800
committerJun Fang <jun_fang@foxitsoftware.com>2016-02-04 17:47:00 -0800
commitf7e38ede94095029b242497025413951a555e5cd (patch)
tree65530cf87cdb2702e7baa1156d0da98c38a43c13 /fpdfsdk/src/fpdfxfa
parent4d0717934b7146a0fec7462ba131bd33f5dc246a (diff)
downloadpdfium-f7e38ede94095029b242497025413951a555e5cd.tar.xz
Fix a crasher in CPDFSDK_Document::GetPageView()
BUG=pdfium:369 TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1667643002 . Review URL: https://codereview.chromium.org/1668283003 .
Diffstat (limited to 'fpdfsdk/src/fpdfxfa')
-rw-r--r--fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp23
1 files changed, 10 insertions, 13 deletions
diff --git a/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp b/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp
index b8549fce74..b937af4f2c 100644
--- a/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp
+++ b/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp
@@ -45,18 +45,6 @@ CPDFXFA_Document::CPDFXFA_Document(CPDF_Document* pPDFDoc,
}
CPDFXFA_Document::~CPDFXFA_Document() {
- if (m_pJSContext && m_pSDKDoc && m_pSDKDoc->GetEnv())
- m_pSDKDoc->GetEnv()->GetJSRuntime()->ReleaseContext(m_pJSContext);
-
- delete m_pSDKDoc;
-
- if (m_pPDFDoc) {
- CPDF_Parser* pParser = m_pPDFDoc->GetParser();
- if (pParser)
- delete pParser;
- else
- delete m_pPDFDoc;
- }
if (m_pXFADoc) {
IXFA_App* pApp = m_pApp->GetXFAApp();
if (pApp) {
@@ -67,6 +55,16 @@ CPDFXFA_Document::~CPDFXFA_Document() {
}
delete m_pXFADoc;
}
+ if (m_pJSContext && m_pSDKDoc && m_pSDKDoc->GetEnv())
+ m_pSDKDoc->GetEnv()->GetJSRuntime()->ReleaseContext(m_pJSContext);
+ delete m_pSDKDoc;
+ if (m_pPDFDoc) {
+ CPDF_Parser* pParser = m_pPDFDoc->GetParser();
+ if (pParser)
+ delete pParser;
+ else
+ delete m_pPDFDoc;
+ }
}
FX_BOOL CPDFXFA_Document::LoadXFADoc() {
@@ -490,7 +488,6 @@ void CPDFXFA_Document::PageViewEvent(IXFA_PageView* pPageView,
if (!pPage)
return;
pEnv->FFI_PageEvent(pPage->GetPageIndex(), dwFlags);
- m_pSDKDoc->GetPageView(pPage)->ClearFXAnnots();
pPage->Release();
}