summaryrefslogtreecommitdiff
path: root/vcl/unx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-05-06 14:27:42 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-05-07 08:31:22 +0200
commit024f3e05e5a0ccf189903caede2ace7ba3e6f3de (patch)
tree5aafe88df3ad33ded2b59c7309f2a2b3c8929d87 /vcl/unx
parent3484dff661d7418ecf4da48faac27ae64e01ec5f (diff)
fix leak in FreetypeFontInfo::AnnounceFont
the Add can fail, and this is a reference-counted type Change-Id: I9a6e7656a8c744222b4b10031cc6fd54e67c8ce0 Reviewed-on: https://gerrit.libreoffice.org/71858 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/unx')
-rw-r--r--vcl/unx/generic/glyphs/freetype_glyphcache.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
index 691b3f004f12..4e3a834e95c7 100644
--- a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
+++ b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
@@ -304,8 +304,8 @@ const unsigned char* FreetypeFontInfo::GetTable( const char* pTag, sal_uLong* pL
void FreetypeFontInfo::AnnounceFont( PhysicalFontCollection* pFontCollection )
{
- FreetypeFontFace* pFD = new FreetypeFontFace( this, maDevFontAttributes );
- pFontCollection->Add( pFD );
+ rtl::Reference<FreetypeFontFace> pFD(new FreetypeFontFace( this, maDevFontAttributes ));
+ pFontCollection->Add( pFD.get() );
}
void GlyphCache::InitFreetype()