summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-10-05 15:46:15 -0700
committerCommit bot <commit-bot@chromium.org>2016-10-05 15:46:15 -0700
commit2116105b7d0545eb353264d4b42420cf51af5195 (patch)
tree959cb01c9d4049a9354657a7ea772b1c2860ab92 /fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
parente883afcab15b17769bda0a1aac0f540568df3368 (diff)
downloadpdfium-2116105b7d0545eb353264d4b42420cf51af5195.tar.xz
Remove ownership of CPDFSDK_Document from CPDFXFA_Document
This CL updates CPDFXFA_Document so it never owns the CPDFSDK_Document. The CPDFSDK_Document is now always owned by the CPDFXFA_Environment. This also cleans up the strange need to reverse the order of document and form destruction when using XFA. Review-Url: https://codereview.chromium.org/2397473006
Diffstat (limited to 'fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp')
-rw-r--r--fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
index 1b27e16551..fed5409624 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
@@ -258,7 +258,11 @@ FX_BOOL CPDFXFA_DocEnvironment::PopupMenu(CXFA_FFWidget* hWidget,
void CPDFXFA_DocEnvironment::PageViewEvent(CXFA_FFPageView* pPageView,
uint32_t dwFlags) {
- CPDFSDK_Environment* pEnv = m_pDocument->GetSDKDoc()->GetEnv();
+ CPDFSDK_Document* pSDKDoc = m_pDocument->GetSDKDoc();
+ if (!pSDKDoc)
+ return;
+
+ CPDFSDK_Environment* pEnv = pSDKDoc->GetEnv();
if (!pEnv)
return;