From 28d30b4870fb5327937fa0541d0059fc439736aa Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Mon, 4 Jun 2018 17:12:27 +0000 Subject: Revert "Remove more ifndef XFA cases" This reverts commit 38cb7263a0923dd5613da24b18d3d7ef052ff5e3. Reason for revert: Blocking prior revert. Original change's description: > Remove more ifndef XFA cases > > Remove FXFT_Clear_Face_External_Stream() calls, period. This would cause > FT to try to free memory allocated by the caller, with potentially a > different allocator. If we're leaking, msan will find it, and we can > deal with it properly rather than trying to force FT to tidy after us. > > Always call SetView(), if we have a PDF page. At worst, the link won't > be used in the XFA case. > > Always return 0 for the null document permissions. If we don't have a > document, then we can't dynamically tell if its an XFA doc, so there's > no reason to believe it should have all permissions. If there is an > XFA doc under the covers, then the extension will give us the value. > > > Change-Id: I6e3fb589eda722786567d96288cb35f43643437b > Reviewed-on: https://pdfium-review.googlesource.com/33370 > Commit-Queue: Tom Sepez > Reviewed-by: Lei Zhang TBR=thestig@chromium.org,tsepez@chromium.org # Not skipping CQ checks because original CL landed > 1 day ago. Change-Id: I68b6a50ef28fb3d6ab9d8494c4486ca9fb66589e Reviewed-on: https://pdfium-review.googlesource.com/33734 Reviewed-by: Tom Sepez Commit-Queue: Tom Sepez --- core/fxge/cfx_font.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'core/fxge') diff --git a/core/fxge/cfx_font.cpp b/core/fxge/cfx_font.cpp index 08e33d6397..bee1d789ef 100644 --- a/core/fxge/cfx_font.cpp +++ b/core/fxge/cfx_font.cpp @@ -317,9 +317,14 @@ void CFX_Font::SetSubstFont(std::unique_ptr subst) { #endif // PDF_ENABLE_XFA CFX_Font::~CFX_Font() { - if (m_Face) + if (m_Face) { +#ifndef PDF_ENABLE_XFA + if (FXFT_Get_Face_External_Stream(m_Face)) { + FXFT_Clear_Face_External_Stream(m_Face); + } +#endif // PDF_ENABLE_XFA DeleteFace(); - + } #if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ ReleasePlatformResource(); #endif -- cgit v1.2.3