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

Unified Diff: pdf/pdfium/pdfium_engine.cc

Issue 1230313006: PDF: Revert to the original shut down order for non-XFA. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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: pdf/pdfium/pdfium_engine.cc
diff --git a/pdf/pdfium/pdfium_engine.cc b/pdf/pdfium/pdfium_engine.cc
index 0cc8b2613ce156ffcc32300872e604caeb166d8a..e00be780804ea77b5b569973cef187df1c3d9a70 100644
--- a/pdf/pdfium/pdfium_engine.cc
+++ b/pdf/pdfium/pdfium_engine.cc
@@ -677,8 +677,16 @@ PDFiumEngine::~PDFiumEngine() {
if (doc_) {
FORM_DoDocumentAAction(form_, FPDFDOC_AACTION_WC);
+
+#ifdef PDF_USE_XFA
+ // XFA may require |form_| to outlive |doc_|, so shut down in that order.
FPDF_CloseDocument(doc_);
FPDFDOC_ExitFormFillEnvironment(form_);
+#else
+ // Normally |doc_| should outlive |form_|.
+ FPDFDOC_ExitFormFillEnvironment(form_);
+ FPDF_CloseDocument(doc_);
+#endif
}
FPDFAvail_Destroy(fpdf_availability_);
« 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