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

Issue 2322043002: Fix memory management errors for font loading and copying (Closed)

Created:
4 years, 3 months ago by Wei Li
Modified:
4 years, 3 months ago
Reviewers:
Lei Zhang, dsinclair
CC:
pdfium-reviews_googlegroups.com
Target Ref:
refs/heads/master
Project:
pdfium
Visibility:
Public.

Description

Fix memory management errors for font loading and copying A few issues are fixed: --Change variable |m_bLogic| in CFX_Font to |m_bShallowCopy| to reflect its meaning better; --For a shallow copy of font, we must guarantee that the copied font will not be deleted until the shallow copy is deleted. So need to increase the src font's refcount when copying it; --The stream |m_pOwnedStream| needs to have matched new/delete These errors need to be fixed before we can properly delete all the fonts to address the leaks. BUG=pdfium:242 Committed: https://pdfium.googlesource.com/pdfium/+/c29fc707b24b9528e41a242cfa298275708ffc76

Patch Set 1 #

Patch Set 2 : const #

Total comments: 2

Patch Set 3 : address comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+21 lines, -12 lines) Patch
M core/fxge/ge/cfx_font.cpp View 4 chunks +4 lines, -4 lines 0 comments Download
M core/fxge/include/fx_font.h View 1 chunk +2 lines, -2 lines 0 comments Download
M xfa/fgas/font/fgas_gefont.h View 1 2 chunks +2 lines, -1 line 0 comments Download
M xfa/fgas/font/fgas_gefont.cpp View 1 2 3 chunks +13 lines, -5 lines 0 comments Download

Messages

Total messages: 18 (13 generated)
Wei Li
pls review, thanks
4 years, 3 months ago (2016-09-08 18:17:48 UTC) #7
dsinclair
lgtm w/ nit https://codereview.chromium.org/2322043002/diff/20001/xfa/fgas/font/fgas_gefont.cpp File xfa/fgas/font/fgas_gefont.cpp (right): https://codereview.chromium.org/2322043002/diff/20001/xfa/fgas/font/fgas_gefont.cpp#newcode99 xfa/fgas/font/fgas_gefont.cpp:99: ASSERT(src->m_pFont); Can we change the src-> ...
4 years, 3 months ago (2016-09-08 18:27:22 UTC) #8
Wei Li
thanks, fixed https://codereview.chromium.org/2322043002/diff/20001/xfa/fgas/font/fgas_gefont.cpp File xfa/fgas/font/fgas_gefont.cpp (right): https://codereview.chromium.org/2322043002/diff/20001/xfa/fgas/font/fgas_gefont.cpp#newcode99 xfa/fgas/font/fgas_gefont.cpp:99: ASSERT(src->m_pFont); On 2016/09/08 18:27:22, dsinclair wrote: > ...
4 years, 3 months ago (2016-09-08 18:42:02 UTC) #11
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/2322043002/40001
4 years, 3 months ago (2016-09-08 18:47:15 UTC) #16
commit-bot: I haz the power
4 years, 3 months ago (2016-09-08 18:47:33 UTC) #18
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://pdfium.googlesource.com/pdfium/+/c29fc707b24b9528e41a242cfa298275708f...

Powered by Google App Engine
This is Rietveld 408576698