From 7cda31ac2f2884166f044937619478a6103198cf Mon Sep 17 00:00:00 2001 From: tsepez Date: Wed, 7 Dec 2016 12:10:20 -0800 Subject: Refcount IFGAS_ streams all the time, too IFGAS_Streams are not part of the IFX_Stream hierarchy, but can be made from such. Review-Url: https://codereview.chromium.org/2559763002 --- xfa/fgas/font/cfgas_gefont.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'xfa/fgas/font/cfgas_gefont.cpp') diff --git a/xfa/fgas/font/cfgas_gefont.cpp b/xfa/fgas/font/cfgas_gefont.cpp index 3bca4dc09f..bc971f6294 100644 --- a/xfa/fgas/font/cfgas_gefont.cpp +++ b/xfa/fgas/font/cfgas_gefont.cpp @@ -72,9 +72,10 @@ CFGAS_GEFont* CFGAS_GEFont::LoadFont(const uint8_t* pBuffer, } // static -CFGAS_GEFont* CFGAS_GEFont::LoadFont(IFGAS_Stream* pFontStream, - CFGAS_FontMgr* pFontMgr, - bool bSaveStream) { +CFGAS_GEFont* CFGAS_GEFont::LoadFont( + const CFX_RetainPtr& pFontStream, + CFGAS_FontMgr* pFontMgr, + bool bSaveStream) { CFGAS_GEFont* pFont = new CFGAS_GEFont(pFontMgr); if (!pFont->LoadFontInternal(pFontStream, bSaveStream)) { pFont->Release(); @@ -203,12 +204,13 @@ bool CFGAS_GEFont::LoadFontInternal(const uint8_t* pBuffer, int32_t length) { return InitFont(); } -bool CFGAS_GEFont::LoadFontInternal(IFGAS_Stream* pFontStream, - bool bSaveStream) { +bool CFGAS_GEFont::LoadFontInternal( + const CFX_RetainPtr& pFontStream, + bool bSaveStream) { if (m_pFont || m_pFileRead || !pFontStream || pFontStream->GetLength() < 1) return false; if (bSaveStream) - m_pStream.reset(pFontStream); + m_pStream = pFontStream; m_pFileRead = pFontStream->MakeSeekableReadStream(); m_pFont = new CFX_Font; -- cgit v1.2.3