Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1026)

Unified Diff: fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp

Issue 1667643002: Fix a crashier in CPDFSDK_Document::GetPageView() (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp
diff --git a/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp b/fpdfsdk/src/fpdfxfa/fpdfxfa_doc.cpp
index b8549fce74b0753aecc95576f2f4b6cab094df09..b937af4f2c6e5d336c54cfd2530bb94cce991da9 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();
jun_fang 2016/02/04 06:15:10 When a XFA page is deleted, it doesn't need to cle
pPage->Release();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698