diff options
author | Jiang Jiang <jiang.jiang@nokia.com> | 2011-06-21 07:25:19 (GMT) |
---|---|---|
committer | Jiang Jiang <jiang.jiang@nokia.com> | 2011-06-21 07:32:09 (GMT) |
commit | 39dffd14b9544955e294899ca7125a0b913607c6 (patch) | |
tree | ecf0d8121d43b8b9744c8f553ad2e7373a2988ff /src/gui/text/qfontengine_x11.cpp | |
parent | 94db89e69c3b08db111f6434dcc7a7d39f756574 (diff) | |
download | Qt-39dffd14b9544955e294899ca7125a0b913607c6.zip Qt-39dffd14b9544955e294899ca7125a0b913607c6.tar.gz Qt-39dffd14b9544955e294899ca7125a0b913607c6.tar.bz2 |
Proper fix for previous deallocation problem
The match FcPattern should be managed by QFontDatabase instead of
QFontEngineX11FT since the latter only used it once.
Reviewed-by: Samuel
Diffstat (limited to 'src/gui/text/qfontengine_x11.cpp')
-rw-r--r-- | src/gui/text/qfontengine_x11.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/gui/text/qfontengine_x11.cpp b/src/gui/text/qfontengine_x11.cpp index 74c0130..490866c 100644 --- a/src/gui/text/qfontengine_x11.cpp +++ b/src/gui/text/qfontengine_x11.cpp @@ -946,6 +946,7 @@ void QFontEngineMultiFT::loadEngine(int at) fontEngine = engineForPattern(match, request, screen); QFontCache::instance()->insertEngine(key, fontEngine); } + FcPatternDestroy(match); fontEngine->ref.ref(); engines[at] = fontEngine; } @@ -1113,17 +1114,14 @@ QFontEngineX11FT::QFontEngineX11FT(FcPattern *pattern, const QFontDef &fd, int s } #endif - if (!init(face_id, antialias, defaultFormat)) { - FcPatternDestroy(pattern); + if (!init(face_id, antialias, defaultFormat)) return; - } if (!freetype->charset) { FcCharSet *cs; FcPatternGetCharSet (pattern, FC_CHARSET, 0, &cs); freetype->charset = FcCharSetCopy(cs); } - FcPatternDestroy(pattern); } QFontEngineX11FT::~QFontEngineX11FT() |