From af16eb5a225e00018d11896d4f447716d1f1124d Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 3 Apr 2017 15:24:26 +0100 Subject: flush writer fontcache after TestImportDOC to get around leak sanitizer Change-Id: I45f0caefc14c35476e92887058031dddd92afb81 --- sw/inc/shellio.hxx | 1 + sw/source/core/txtnode/swfntcch.cxx | 5 +++++ sw/source/filter/ww8/ww8par.cxx | 2 ++ 3 files changed, 8 insertions(+) diff --git a/sw/inc/shellio.hxx b/sw/inc/shellio.hxx index 298f4c465647..893990b22305 100644 --- a/sw/inc/shellio.hxx +++ b/sw/inc/shellio.hxx @@ -179,6 +179,7 @@ protected: extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportDOC(SvStream &rStream, const OUString &rFltName); extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportRTF(SvStream &rStream); +SAL_DLLPUBLIC_EXPORT void FlushFontCache(); class SW_DLLPUBLIC Reader { diff --git a/sw/source/core/txtnode/swfntcch.cxx b/sw/source/core/txtnode/swfntcch.cxx index 9e938dc6bee5..58269d218431 100644 --- a/sw/source/core/txtnode/swfntcch.cxx +++ b/sw/source/core/txtnode/swfntcch.cxx @@ -60,4 +60,9 @@ SwCacheObj *SwFontAccess::NewObj( ) return new SwFontObj( m_pOwner, pShell ); } +SAL_DLLPUBLIC_EXPORT void FlushFontCache() +{ + pSwFontCache->Flush(); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 85e17a57f258..eb75ce5f0413 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -6216,6 +6216,8 @@ bool SAL_CALL TestImportDOC(SvStream &rStream, const OUString &rFltName) bool bRet = pReader->Read(*pD, OUString(), aPaM, OUString()) == 0; delete pReader; + FlushFontCache(); + return bRet; } -- cgit