From 7e4e63b04f87c690b017c43ebbb3218eb30c459a Mon Sep 17 00:00:00 2001 From: weili Date: Thu, 1 Sep 2016 17:42:11 -0700 Subject: Revert of Fix leaked internal font (patchset #2 id:60001 of https://codereview.chromium.org/2297303004/ ) Reason for revert: asan bot doesn't like it, will investigate Original issue's description: > Fix leaked internal font > > In CFGAS_FontMgrImp::LoadFont(), a new internal font is created which > is never released. It needs to be correctly marked as internal font to > be released. Fix this by adding a boolean parameter and pass it along > during the creation of the font. > > BUG=pdfium:242 > > Committed: https://pdfium.googlesource.com/pdfium/+/6708106e6a3d54f3370c871ebf6643d1ecf58999 TBR=thestig@chromium.org,dsinclair@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=pdfium:242 Review-Url: https://codereview.chromium.org/2302213002 --- xfa/fgas/font/fgas_gefont.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'xfa/fgas/font/fgas_gefont.h') diff --git a/xfa/fgas/font/fgas_gefont.h b/xfa/fgas/font/fgas_gefont.h index 05c7640afb..cdb19338a2 100644 --- a/xfa/fgas/font/fgas_gefont.h +++ b/xfa/fgas/font/fgas_gefont.h @@ -24,10 +24,7 @@ class CFGAS_GEFont { uint32_t dwFontStyles, uint16_t wCodePage, IFGAS_FontMgr* pFontMgr); - static CFGAS_GEFont* LoadFont(CFX_Font* pExternalFont, - IFGAS_FontMgr* pFontMgr); - static CFGAS_GEFont* LoadFont(std::unique_ptr pInternalFont, - IFGAS_FontMgr* pFontMgr); + static CFGAS_GEFont* LoadFont(CFX_Font* pExtFont, IFGAS_FontMgr* pFontMgr); #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ static CFGAS_GEFont* LoadFont(const uint8_t* pBuffer, int32_t iLength, @@ -77,8 +74,7 @@ class CFGAS_GEFont { FX_BOOL LoadFontInternal(const uint8_t* pBuffer, int32_t length); FX_BOOL LoadFontInternal(IFX_Stream* pFontStream, FX_BOOL bSaveStream); #endif - FX_BOOL LoadFontInternal(CFX_Font* pExternalFont); - FX_BOOL LoadFontInternal(std::unique_ptr pInternalFont); + FX_BOOL LoadFontInternal(CFX_Font* pExtFont); FX_BOOL InitFont(); FX_BOOL GetCharBBoxInternal(FX_WCHAR wUnicode, CFX_Rect& bbox, @@ -100,7 +96,7 @@ class CFGAS_GEFont { CFX_Font* m_pFont; IFGAS_FontMgr* const m_pFontMgr; int32_t m_iRefCount; - bool m_bExternalFont; + FX_BOOL m_bExtFont; std::unique_ptr> m_pStream; std::unique_ptr> m_pFileRead; std::unique_ptr m_pFontEncoding; -- cgit v1.2.3