summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
authorJiang Jiang <jiang.jiang@nokia.com>2011-02-23 11:07:10 (GMT)
committerJiang Jiang <jiang.jiang@nokia.com>2011-07-12 05:59:44 (GMT)
commitade1378a4fc479d7ff3de3eb636c222c195a9082 (patch)
tree73c2c74d072b9555689e15ca4b2ac35ef51f5346 /src/gui/text
parent5f2b6dd2a50275bc05ae5d7e9dd8902d6d49d9df (diff)
downloadQt-ade1378a4fc479d7ff3de3eb636c222c195a9082.zip
Qt-ade1378a4fc479d7ff3de3eb636c222c195a9082.tar.gz
Qt-ade1378a4fc479d7ff3de3eb636c222c195a9082.tar.bz2
Check engine existence before increasing reference count
Reviewed-by: TrustMe (cherry picked from commit 244620438700464a862ceab7c881974a5b1d1fea)
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qtextengine.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 6322245..648f5c0 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;