summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
authorKarim Pinter <karim.pinter@digia.com>2012-09-25 10:31:48 +0300
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-31 01:03:22 +0100
commit185ab927308ae88228321532e4070517736eb640 (patch)
tree8dd60f4c85cc32cb2379d19674f841e0c0e18062 /src/gui/text
parent2d652e9a00ad448047d58184512d93d4cfdb55f3 (diff)
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>
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qfontdatabase_x11.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/text/qfontdatabase_x11.cpp b/src/gui/text/qfontdatabase_x11.cpp
index e9012c639d..3cde03b87d 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;
}