diff options
author | jian liang <jianliang79@gmail.com> | 2012-02-05 23:09:36 +0800 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-06 16:48:22 +0100 |
commit | effbc9edc57fd8a2e40729a76004fe4f5fafcf49 (patch) | |
tree | 07f5929f28182d370db44c06b4354f150ee4e576 /src/gui/text | |
parent | 1bc8af96c9ae7a2f0e8df2deeae09f5e342bb5e4 (diff) |
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>
Diffstat (limited to 'src/gui/text')
-rw-r--r-- | src/gui/text/qfontdatabase_qpa.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
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)) { |