diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-03-10 12:27:29 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-03-10 12:27:29 +0000 |
commit | 91c4ed9f33f5008e740ca14887b041e39bc71064 (patch) | |
tree | 8bdcc244055b3ab1c4f6ad9524703b085f6d4ea7 /vcl/source/glyphs | |
parent | 3222a76e29bf85630ca30a24cf2c2399cc159354 (diff) |
remove FtFontFile leaks
Diffstat (limited to 'vcl/source/glyphs')
-rw-r--r-- | vcl/source/glyphs/gcach_ftyp.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
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<const char*,FtFontFile*,HashStr, EqStr> FontFileList; +typedef ::boost::unordered_map<const char*,boost::shared_ptr<FtFontFile>,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; } |