diff --git a/src/gui/text/qfontdatabase_qpa.cpp b/src/gui/text/qfontdatabase_qpa.cpp index 16777d593c..c57fe4b343 100644 --- a/src/gui/text/qfontdatabase_qpa.cpp +++ b/src/gui/text/qfontdatabase_qpa.cpp @@ -377,8 +377,12 @@ void QFontDatabase::load(const QFontPrivate *d, int script) req.family = *it; fe = QFontDatabase::findFont(script, d, req, multi); - if (fe && (fe->type()==QFontEngine::Box) && !req.family.isEmpty()) + if (fe && (fe->type()==QFontEngine::Box) && !req.family.isEmpty()) { + if (fe->ref.load() == 0) + delete fe; + fe = 0; + } } if (fe->symbol || (d->request.styleStrategy & QFont::NoFontMerging)) {