summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfformfill_embeddertest.cpp
diff options
context:
space:
mode:
authorweili <weili@chromium.org>2016-08-23 21:10:57 -0700
committerCommit bot <commit-bot@chromium.org>2016-08-23 21:10:57 -0700
commit0dadcc6fdab7ad1f2ee95d763f31aad5d3534f93 (patch)
treed62cd8cc5b33e8b3707bbdb6eb5bbf6269f52110 /fpdfsdk/fpdfformfill_embeddertest.cpp
parente07edce5b253bc4f2bef6888c5b1cbf0b320a919 (diff)
downloadpdfium-0dadcc6fdab7ad1f2ee95d763f31aad5d3534f93.tar.xz
Fix page leaks in an embedder test
Embedder test's delegate function GetPage() calls FPDF_LoadPage() to load a page which may be already loaded by embedder test itself. Thus the page's ref count is increased unnecessarily. This causes the page to be leaked. Fix this by putting the page map in embedder test class and guarantee the page is loaded only once. Also, fix leaks in this embedder tests by unloading the loaded pages to properly release the resource. BUG=pdfium:242 Review-Url: https://codereview.chromium.org/2258333002
Diffstat (limited to 'fpdfsdk/fpdfformfill_embeddertest.cpp')
-rw-r--r--fpdfsdk/fpdfformfill_embeddertest.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/fpdfsdk/fpdfformfill_embeddertest.cpp b/fpdfsdk/fpdfformfill_embeddertest.cpp
index 3a6a7448e5..baf4853f17 100644
--- a/fpdfsdk/fpdfformfill_embeddertest.cpp
+++ b/fpdfsdk/fpdfformfill_embeddertest.cpp
@@ -45,7 +45,7 @@ TEST_F(FPDFFormFillEmbeddertest, BUG_507316) {
SetDelegate(&delegate);
EXPECT_TRUE(OpenDocument("bug_507316.pdf"));
- FPDF_PAGE page = LoadAndCachePage(2);
+ FPDF_PAGE page = LoadPage(2);
EXPECT_TRUE(page);
DoOpenActions();
delegate.AdvanceTime(4000);