summaryrefslogtreecommitdiff
path: root/testing/embedder_test.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2016-10-06 14:53:13 -0400
committerDan Sinclair <dsinclair@chromium.org>2016-10-06 14:53:13 -0400
commitca03f7a1c654709152a411f665ce38c3626582e8 (patch)
tree21219202db1f20f84e8bc625662278091f856094 /testing/embedder_test.cpp
parentf7ca7302bed831801a0b81ff4e1222c75833d2d6 (diff)
downloadpdfium-ca03f7a1c654709152a411f665ce38c3626582e8.tar.xz
Fixup MSan embeddertests
The embeddertests were closing the document before the formfill environment. This caused a use-after-free as we try to use the document during formfill destruction. This Cl fixes the destruction order in the embedder tests. As well, a few guards are put in place to keep the system from crashing if the wrong destruction order is called. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/2398063002 .
Diffstat (limited to 'testing/embedder_test.cpp')
-rw-r--r--testing/embedder_test.cpp8
1 files changed, 0 insertions, 8 deletions
diff --git a/testing/embedder_test.cpp b/testing/embedder_test.cpp
index 1ce0f36a45..c23b5c8018 100644
--- a/testing/embedder_test.cpp
+++ b/testing/embedder_test.cpp
@@ -99,16 +99,8 @@ void EmbedderTest::SetUp() {
void EmbedderTest::TearDown() {
if (document_) {
FORM_DoDocumentAAction(form_handle_, FPDFDOC_AACTION_WC);
-#ifdef PDF_ENABLE_XFA
- // Note: The shut down order here is the reverse of the non-XFA branch
- // order. Need to work out if this is required, and if it is, the lifetimes
- // of objects owned by |doc| that |form| reference.
- FPDF_CloseDocument(document_);
- FPDFDOC_ExitFormFillEnvironment(form_handle_);
-#else // PDF_ENABLE_XFA
FPDFDOC_ExitFormFillEnvironment(form_handle_);
FPDF_CloseDocument(document_);
-#endif // PDF_ENABLE_XFA
}
FPDFAvail_Destroy(avail_);