diff options
author | Jiang Jiang <jiang.jiang@nokia.com> | 2011-02-23 11:07:10 (GMT) |
---|---|---|
committer | Jiang Jiang <jiang.jiang@nokia.com> | 2011-02-23 11:07:10 (GMT) |
commit | 244620438700464a862ceab7c881974a5b1d1fea (patch) | |
tree | 94fe85d4b2b585e581123010b946b8a7b0af9183 /src/gui | |
parent | 6e23fb69e441871829765ff512e90fed17b6798d (diff) | |
download | Qt-244620438700464a862ceab7c881974a5b1d1fea.zip Qt-244620438700464a862ceab7c881974a5b1d1fea.tar.gz Qt-244620438700464a862ceab7c881974a5b1d1fea.tar.bz2 |
Check engine existence before increasing reference count
Reviewed-by: TrustMe
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/text/qtextengine.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index d2e8291..a63fdbf 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -1836,9 +1836,11 @@ QFontEngine *QTextEngine::fontEngine(const QScriptItem &si, QFixed *ascent, QFix scaledEngine = font.d->engineForScript(script); } feCache.prevFontEngine = engine; - engine->ref.ref(); + if (engine) + engine->ref.ref(); feCache.prevScaledFontEngine = scaledEngine; - scaledEngine->ref.ref(); + if (scaledEngine) + scaledEngine->ref.ref(); feCache.prevScript = script; feCache.prevPosition = si.position; feCache.prevLength = length(&si); @@ -1849,7 +1851,8 @@ QFontEngine *QTextEngine::fontEngine(const QScriptItem &si, QFixed *ascent, QFix else { engine = font.d->engineForScript(script); feCache.prevFontEngine = engine; - engine->ref.ref(); + if (engine) + engine->ref.ref(); feCache.prevScript = script; feCache.prevPosition = -1; feCache.prevLength = -1; |