From 909c6e7d2623f76dee27502d693f8b4fbb8b7649 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 12 Jun 2018 13:38:55 +0000 Subject: Remove explicit calls to FXFT_Clear_Face_External_Stream(). This landed earlier as part of a larger change that got reverted for unrelated reasons. Now re-land it by itself. See https://pdfium-review.googlesource.com/c/pdfium/+/33370 The current code could cause FT to try to free memory allocated by the caller, with potentially a different allocator. It appears that this may have been added ages ago as a way to kludge around a leak. 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. Change-Id: I20abf4cd35d465de1f435ebe6d94b10c3ff74002 Reviewed-on: https://pdfium-review.googlesource.com/34930 Reviewed-by: dsinclair Commit-Queue: dsinclair --- core/fxge/cfx_font.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'core') diff --git a/core/fxge/cfx_font.cpp b/core/fxge/cfx_font.cpp index bee1d789ef..08e33d6397 100644 --- a/core/fxge/cfx_font.cpp +++ b/core/fxge/cfx_font.cpp @@ -317,14 +317,9 @@ void CFX_Font::SetSubstFont(std::unique_ptr subst) { #endif // PDF_ENABLE_XFA CFX_Font::~CFX_Font() { - 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 + if (m_Face) DeleteFace(); - } + #if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ ReleasePlatformResource(); #endif -- cgit v1.2.3