diff options
author | Karim Pinter <karim.pinter@digia.com> | 2012-09-25 07:31:48 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-31 00:03:22 (GMT) |
commit | 185ab927308ae88228321532e4070517736eb640 (patch) | |
tree | 8dd60f4c85cc32cb2379d19674f841e0c0e18062 | |
parent | 2d652e9a00ad448047d58184512d93d4cfdb55f3 (diff) | |
download | Qt-185ab927308ae88228321532e4070517736eb640.zip Qt-185ab927308ae88228321532e4070517736eb640.tar.gz Qt-185ab927308ae88228321532e4070517736eb640.tar.bz2 |
Fixing font database memoryleak
There is one case when the QFontEngine* fe is loaded, then FcPattern*
match loaded from FcFontRenderPrepare is not deleted. Valgrind was
showing this problem, after the fix there is no memoryleak in Valgrind.
Change-Id: I8ef928fe8190a6d26f2e5275b85e08a7a8796a7b
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Jiang Jiang <gzjjgod@gmail.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
-rw-r--r-- | src/gui/text/qfontdatabase_x11.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/text/qfontdatabase_x11.cpp b/src/gui/text/qfontdatabase_x11.cpp index e9012c6..3cde03b 100644 --- a/src/gui/text/qfontdatabase_x11.cpp +++ b/src/gui/text/qfontdatabase_x11.cpp @@ -1740,9 +1740,9 @@ static QFontEngine *loadFc(const QFontPrivate *fp, int script, const QFontDef &r fe = new QFontEngineMultiFT(fe, match, pattern, fp->screen, request); } else { FcPatternDestroy(pattern); - if (match) - FcPatternDestroy(match); } + if (match) + FcPatternDestroy(match); return fe; } |