diff options
author | Konstantin Ritt <ritt.ks@gmail.com> | 2014-11-14 14:15:04 +0400 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@theqtcompany.com> | 2014-11-15 14:45:43 +0100 |
commit | 0600f7d6299a21014f1b72d54fc6b23c02693204 (patch) | |
tree | 78d0a84735e0c3030402bb8519f6ee3dd32a3c71 /src/gui/text/qharfbuzzng.cpp | |
parent | f44eb5c57f28825e29425be339a00df5d99b68eb (diff) | |
download | qtbase-0600f7d6299a21014f1b72d54fc6b23c02693204.tar.gz |
Fix hb_face leaking in QFontEngineFT
Since HarfBuzz-old's HB_Face doesn't support ref-counting,
it is impossible to keep the same behavior as for NG's ref-counted hb_face
when we're going to reparent the data of unknown type in QFontEngineFT.
We should either not release the object returned by harfbuzzFace(),
or introduce ref-counting for HB-old's HB_Face. Stop referencing HB-NG's
objects on access for now and thus avoid a need to release them manually.
Task-number: QTBUG-42674
Change-Id: Ia21e7ba9c17185796b0dd98c2c27d02566f2a701
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Diffstat (limited to 'src/gui/text/qharfbuzzng.cpp')
-rw-r--r-- | src/gui/text/qharfbuzzng.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/gui/text/qharfbuzzng.cpp b/src/gui/text/qharfbuzzng.cpp index eb7bca1974..16c45e642b 100644 --- a/src/gui/text/qharfbuzzng.cpp +++ b/src/gui/text/qharfbuzzng.cpp @@ -632,7 +632,7 @@ hb_face_t *hb_qt_face_get_for_engine(QFontEngine *fe) fe->face_destroy_func = _hb_qt_face_release; } - return hb_face_reference((hb_face_t *)fe->face_); + return (hb_face_t *)fe->face_; } @@ -645,8 +645,6 @@ _hb_qt_font_create(QFontEngine *fe) hb_font_t *font = hb_font_create(face); - hb_face_destroy(face); // ref-ed in hb_qt_face_get_for_engine() - if (Q_UNLIKELY(hb_font_is_immutable(font))) { hb_font_destroy(font); return NULL; @@ -684,7 +682,7 @@ hb_font_t *hb_qt_font_get_for_engine(QFontEngine *fe) fe->font_destroy_func = _hb_qt_font_release; } - return hb_font_reference((hb_font_t *)fe->font_); + return (hb_font_t *)fe->font_; } QT_END_NAMESPACE |