summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfxfa/cpdfxfa_document.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/fpdfxfa/cpdfxfa_document.cpp')
-rw-r--r--fpdfsdk/fpdfxfa/cpdfxfa_document.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_document.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_document.cpp
index bd7f931c59..90a762ddf3 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_document.cpp
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_document.cpp
@@ -45,6 +45,9 @@ CPDFXFA_Document::~CPDFXFA_Document() {
if (m_pSDKDoc) {
m_pSDKDoc->ClearAllFocusedAnnots();
+ // Once we're deleted the SDKDocument will point at a bad underlying
+ // doc so we need to reset it ...
+ m_pSDKDoc->ResetXFADocument();
m_pSDKDoc = nullptr;
}