summaryrefslogtreecommitdiff
path: root/xfa/fgas/font/cfgas_gefont.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-05-19 17:08:52 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-05-20 00:31:33 +0000
commitd15ce4c1e088e8bc084b52b0acdb5f0ef6597f95 (patch)
tree9de96e6b16569746b78a1aec044e10103779a9b4 /xfa/fgas/font/cfgas_gefont.cpp
parent910b7635d72b66a06ab22806ad09b650131b4dc2 (diff)
downloadpdfium-d15ce4c1e088e8bc084b52b0acdb5f0ef6597f95.tar.xz
Use observed ptrs from CFGAS_GEFont back to its font mgrs.chromium/3106
CFGAS_GEFonts are ref counted, and its a good thing since they are managed by at least three different font managers: CFGAS_FontMgr, CXFA_PDFFontMgr, and CXFA_FontMgr. None of these have a clear claim to ownership of the CFGAS_GEFont. CFGAS_GEFont has back-pointers to two of these, CFGAS_FontMgr, and CXFA_PDFFontMgr, and they could each outlive the other. Thus the font needs to watch for destruction of either of its managers, so as to stop using it after its gone. Bug: 724640 Change-Id: I907ec35e300e11e532e13545d51fb200ac86b4f9 Reviewed-on: https://pdfium-review.googlesource.com/5735 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'xfa/fgas/font/cfgas_gefont.cpp')
-rw-r--r--xfa/fgas/font/cfgas_gefont.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/xfa/fgas/font/cfgas_gefont.cpp b/xfa/fgas/font/cfgas_gefont.cpp
index b1bd769336..151aec7d9e 100644
--- a/xfa/fgas/font/cfgas_gefont.cpp
+++ b/xfa/fgas/font/cfgas_gefont.cpp
@@ -61,9 +61,8 @@ CFGAS_GEFont::CFGAS_GEFont(CFGAS_FontMgr* pFontMgr)
m_dwLogFontStyle(0),
#endif
m_pFont(nullptr),
- m_pFontMgr(pFontMgr),
m_bExternalFont(false),
- m_pProvider(nullptr) {
+ m_pFontMgr(pFontMgr) {
}
CFGAS_GEFont::CFGAS_GEFont(const CFX_RetainPtr<CFGAS_GEFont>& src,
@@ -74,10 +73,9 @@ CFGAS_GEFont::CFGAS_GEFont(const CFX_RetainPtr<CFGAS_GEFont>& src,
m_dwLogFontStyle(0),
#endif
m_pFont(nullptr),
- m_pSrcFont(src),
- m_pFontMgr(src->m_pFontMgr),
m_bExternalFont(false),
- m_pProvider(nullptr) {
+ m_pSrcFont(src),
+ m_pFontMgr(src->m_pFontMgr) {
ASSERT(m_pSrcFont->m_pFont);
m_pFont = new CFX_Font;
m_pFont->LoadClone(m_pSrcFont->m_pFont);