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

Issue 2258333002: Fix page leaks in an embedder test (Closed)

Created:
4 years, 4 months ago by Wei Li
Modified:
4 years, 3 months ago
Reviewers:
Tom Sepez, Lei Zhang
CC:
pdfium-reviews_googlegroups.com
Base URL:
https://pdfium.googlesource.com/pdfium.git@master
Target Ref:
refs/heads/master
Project:
pdfium
Visibility:
Public.

Description

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 Committed: https://pdfium.googlesource.com/pdfium/+/0dadcc6fdab7ad1f2ee95d763f31aad5d3534f93

Patch Set 1 #

Total comments: 1

Patch Set 2 : new approach #

Unified diffs Side-by-side diffs Delta from patch set Stats (+25 lines, -35 lines) Patch
M fpdfsdk/fpdfformfill_embeddertest.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M fpdfsdk/fsdk_baseform_embeddertest.cpp View 2 chunks +9 lines, -3 lines 0 comments Download
M testing/embedder_test.h View 1 3 chunks +2 lines, -8 lines 0 comments Download
M testing/embedder_test.cpp View 1 3 chunks +13 lines, -23 lines 0 comments Download

Messages

Total messages: 24 (18 generated)
Wei Li
pls review, thanks
4 years, 4 months ago (2016-08-19 23:54:07 UTC) #5
Tom Sepez
https://codereview.chromium.org/2258333002/diff/20001/fpdfsdk/fsdk_mgr.cpp File fpdfsdk/fsdk_mgr.cpp (right): https://codereview.chromium.org/2258333002/diff/20001/fpdfsdk/fsdk_mgr.cpp#newcode303 fpdfsdk/fsdk_mgr.cpp:303: pTempPage->Release(); might this cause the page to be removed ...
4 years, 3 months ago (2016-08-22 19:42:52 UTC) #8
Wei Li
take another approach, ptal, thanks
4 years, 3 months ago (2016-08-23 18:56:19 UTC) #19
Tom Sepez
I think this works. LGTM.
4 years, 3 months ago (2016-08-24 01:04:41 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2258333002/80001
4 years, 3 months ago (2016-08-24 04:10:48 UTC) #22
commit-bot: I haz the power
4 years, 3 months ago (2016-08-24 04:11:02 UTC) #24
Message was sent while issue was closed.
Committed patchset #2 (id:80001) as
https://pdfium.googlesource.com/pdfium/+/0dadcc6fdab7ad1f2ee95d763f31aad5d353...

Powered by Google App Engine
This is Rietveld 408576698