summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-06-01 13:34:38 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-06-06 10:15:30 +0200
commit3220ada5159307be8a93da3a57d2bfec0c826bf5 (patch)
tree9e477951215499e3bada5df418a5a56f12c6e662
parent18a8cac57d5450fef9111fa356839f07c7593ad0 (diff)
Revert "Blind attempt to fix UBSAN error in FreetypeFont"
to see if this is still a problem after 'fix dubious cache comparison check' This reverts commit b0be0d419576c4ba2ad0f904592879a7736cbfaf. Change-Id: I253a67c3aa5f8daf0e8cd586a5089e554e48f355 Reviewed-on: https://gerrit.libreoffice.org/55185 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--vcl/unx/generic/glyphs/glyphcache.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/vcl/unx/generic/glyphs/glyphcache.cxx b/vcl/unx/generic/glyphs/glyphcache.cxx
index cff473c9036c..ac2eaf5498e3 100644
--- a/vcl/unx/generic/glyphs/glyphcache.cxx
+++ b/vcl/unx/generic/glyphs/glyphcache.cxx
@@ -357,11 +357,18 @@ void FreetypeFontInstance::SetFreetypeFont(FreetypeFont* p)
{
if (p == mpFreetypeFont)
return;
+ if (mpFreetypeFont)
+ mpFreetypeFont->Release();
mpFreetypeFont = p;
+ if (mpFreetypeFont)
+ mpFreetypeFont->AddRef();
}
FreetypeFontInstance::~FreetypeFontInstance()
{
+ // TODO: remove the FreetypeFont here instead of in the GlyphCache
+ if (mpFreetypeFont)
+ mpFreetypeFont->Release();
}
static hb_blob_t* getFontTable(hb_face_t* /*face*/, hb_tag_t nTableTag, void* pUserData)