From e647799f6a2f7f747c9f55d9f0ce08dcdfbd53f4 Mon Sep 17 00:00:00 2001 From: tsepez Date: Thu, 5 Jan 2017 12:57:00 -0800 Subject: Properly ref-count CFGAS_GEFont with CFX_RetainPtr. We worry about cyclical references, but no leaks found. Review-Url: https://codereview.chromium.org/2609423003 --- xfa/fxfa/app/xfa_fwltheme.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'xfa/fxfa/app/xfa_fwltheme.cpp') diff --git a/xfa/fxfa/app/xfa_fwltheme.cpp b/xfa/fxfa/app/xfa_fwltheme.cpp index d12678e51b..1de302e995 100644 --- a/xfa/fxfa/app/xfa_fwltheme.cpp +++ b/xfa/fxfa/app/xfa_fwltheme.cpp @@ -75,10 +75,6 @@ CXFA_FWLTheme::CXFA_FWLTheme(CXFA_FFApp* pApp) CXFA_FWLTheme::~CXFA_FWLTheme() { m_pTextOut.reset(); - if (m_pCalendarFont) { - m_pCalendarFont->Release(); - m_pCalendarFont = nullptr; - } FWLTHEME_Release(); } @@ -193,7 +189,8 @@ float CXFA_FWLTheme::GetFontSize(CFWL_ThemePart* pThemePart) const { return FWLTHEME_CAPACITY_FontSize; } -CFGAS_GEFont* CXFA_FWLTheme::GetFont(CFWL_ThemePart* pThemePart) const { +CFX_RetainPtr CXFA_FWLTheme::GetFont( + CFWL_ThemePart* pThemePart) const { if (CXFA_FFWidget* pWidget = XFA_ThemeGetOuterWidget(pThemePart->m_pWidget)) return pWidget->GetDataAcc()->GetFDEFont(); return GetTheme(pThemePart->m_pWidget)->GetFont(); -- cgit v1.2.3