From 91c4ed9f33f5008e740ca14887b041e39bc71064 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 10 Mar 2011 12:27:29 +0000 Subject: remove FtFontFile leaks --- vcl/source/glyphs/gcach_ftyp.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'vcl/source/glyphs') diff --git a/vcl/source/glyphs/gcach_ftyp.cxx b/vcl/source/glyphs/gcach_ftyp.cxx index 4bb7c247aa2e..43cf4310a879 100644 --- a/vcl/source/glyphs/gcach_ftyp.cxx +++ b/vcl/source/glyphs/gcach_ftyp.cxx @@ -137,7 +137,7 @@ static bool bEnableSizeFT = false; struct EqStr{ bool operator()(const char* a, const char* b) const { return !strcmp(a,b); } }; struct HashStr { size_t operator()( const char* s ) const { return rtl_str_hashCode(s); } }; -typedef ::boost::unordered_map FontFileList; +typedef ::boost::unordered_map,HashStr, EqStr> FontFileList; namespace { struct vclFontFileList : public rtl::Static< FontFileList, vclFontFileList > {}; } // ----------------------------------------------------------------------- @@ -212,12 +212,12 @@ FtFontFile* FtFontFile::FindFontFile( const ::rtl::OString& rNativeFileName ) FontFileList &rFontFileList = vclFontFileList::get(); FontFileList::const_iterator it = rFontFileList.find( pFileName ); if( it != rFontFileList.end() ) - return (*it).second; + return it->second.get(); // no => create new one FtFontFile* pFontFile = new FtFontFile( rNativeFileName ); pFileName = pFontFile->maNativeFileName.getStr(); - rFontFileList[ pFileName ] = pFontFile; + rFontFileList[pFileName].reset(pFontFile); return pFontFile; } -- cgit