Fix memory leak of QFontEngineBox object
Delete QFontEngineBox object in QFontDatabase::load() if the object can not be used. Change-Id: Ifb055809703fb6be92f41fd56658198df30837fd Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
This commit is contained in:
parent
1bc8af96c9
commit
effbc9edc5
@ -377,9 +377,13 @@ 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)) {
|
||||
for (int i = 0; i < QUnicodeTables::ScriptCount; ++i) {
|
||||
|
Loading…
Reference in New Issue
Block a user