diff options
author | Jun Fang <jun_fang@foxitsoftware.com> | 2016-02-01 20:29:55 -0800 |
---|---|---|
committer | Jun Fang <jun_fang@foxitsoftware.com> | 2016-02-01 20:29:55 -0800 |
commit | 23bf560507a8e03968e66480281597be9161abf4 (patch) | |
tree | c33ecb4ae74eb858a35cd1d78f14c46c849b033a /fpdfsdk/src | |
parent | 1be28d1b037de32c75632e10e7d2fc758fe7f962 (diff) | |
download | pdfium-23bf560507a8e03968e66480281597be9161abf4.tar.xz |
Revert "Fix a crashier in CPDFSDK_Document::GetPageView()"
This reverts commit 1be28d1b037de32c75632e10e7d2fc758fe7f962.
BUG=pdfium:369
TBR=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1659463006 .
Diffstat (limited to 'fpdfsdk/src')
-rw-r--r-- | fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp b/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp index 7c2bbf0aea..d37038d2af 100644 --- a/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp +++ b/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp @@ -45,26 +45,28 @@ 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) { IXFA_DocHandler* pDocHandler = pApp->GetDocHandler(); - if (pDocHandler) + if (pDocHandler) { CloseXFADoc(pDocHandler); + } } delete m_pXFADoc; - m_pXFADoc = nullptr; } - if (m_pPDFDoc) { - CPDF_Parser* pParser = m_pPDFDoc->GetParser(); - if (pParser) - delete pParser; - else - delete m_pPDFDoc; - } - if (m_pJSContext && m_pSDKDoc && m_pSDKDoc->GetEnv()) - m_pSDKDoc->GetEnv()->GetJSRuntime()->ReleaseContext(m_pJSContext); - delete m_pSDKDoc; } FX_BOOL CPDFXFA_Document::LoadXFADoc() { @@ -485,6 +487,7 @@ void CPDFXFA_Document::PageViewEvent(IXFA_PageView* pPageView, if (!pPage) return; pPage->SetXFAPageView(nullptr); + m_pSDKDoc->GetPageView(pPage)->ClearFXAnnots(); } void CPDFXFA_Document::WidgetEvent(IXFA_Widget* hWidget, |