From 833619b4441915c7c55085d44b3221eaef0d9800 Mon Sep 17 00:00:00 2001 From: tsepez Date: Wed, 7 Dec 2016 09:21:17 -0800 Subject: Refcount all the IFX_ stream classes all the time. We can remove a lot of "bOwnsStream" logic in the process. Always pass these by const reference, in case the called method wants to hang on to the stream (one exception is where we stick a raw pointer into a void* slot in a context from another layer). Review-Url: https://codereview.chromium.org/2451493002 --- xfa/fgas/font/cfgas_gefont.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 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 1d4624fb0d..3bca4dc09f 100644 --- a/xfa/fgas/font/cfgas_gefont.cpp +++ b/xfa/fgas/font/cfgas_gefont.cpp @@ -210,12 +210,13 @@ bool CFGAS_GEFont::LoadFontInternal(IFGAS_Stream* pFontStream, if (bSaveStream) m_pStream.reset(pFontStream); - m_pFileRead.reset(pFontStream->MakeSeekableReadStream()); + m_pFileRead = pFontStream->MakeSeekableReadStream(); m_pFont = new CFX_Font; - if (m_pFont->LoadFile(m_pFileRead.get())) - return InitFont(); - m_pFileRead.reset(); - return false; + if (!m_pFont->LoadFile(m_pFileRead)) { + m_pFileRead.Reset(); + return false; + } + return InitFont(); } #endif // _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_ -- cgit v1.2.3