summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qharfbuzzng.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/text/qharfbuzzng.cpp')
-rw-r--r--src/gui/text/qharfbuzzng.cpp20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/gui/text/qharfbuzzng.cpp b/src/gui/text/qharfbuzzng.cpp
index e33b461401..55ef9f0d15 100644
--- a/src/gui/text/qharfbuzzng.cpp
+++ b/src/gui/text/qharfbuzzng.cpp
@@ -678,14 +678,10 @@ hb_face_t *hb_qt_face_get_for_engine(QFontEngine *fe)
{
Q_ASSERT(fe && fe->type() != QFontEngine::Multi);
- if (Q_UNLIKELY(!fe->face_)) {
- fe->face_ = _hb_qt_face_create(fe);
- if (Q_UNLIKELY(!fe->face_))
- return NULL;
- fe->face_destroy_func = _hb_qt_face_release;
- }
+ if (Q_UNLIKELY(!fe->face_))
+ fe->face_ = QFontEngine::Holder(_hb_qt_face_create(fe), _hb_qt_face_release);
- return static_cast<hb_face_t *>(fe->face_);
+ return static_cast<hb_face_t *>(fe->face_.get());
}
@@ -728,14 +724,10 @@ hb_font_t *hb_qt_font_get_for_engine(QFontEngine *fe)
{
Q_ASSERT(fe && fe->type() != QFontEngine::Multi);
- if (Q_UNLIKELY(!fe->font_)) {
- fe->font_ = _hb_qt_font_create(fe);
- if (Q_UNLIKELY(!fe->font_))
- return NULL;
- fe->font_destroy_func = _hb_qt_font_release;
- }
+ if (Q_UNLIKELY(!fe->font_))
+ fe->font_ = QFontEngine::Holder(_hb_qt_font_create(fe), _hb_qt_font_release);
- return static_cast<hb_font_t *>(fe->font_);
+ return static_cast<hb_font_t *>(fe->font_.get());
}
QT_END_NAMESPACE