Use QAtomicInt ref/deref pattern

Change check of QAtomicInt::load with the preferred ref() deref() pattern.

Change-Id: I12d2e24812259c16623c8a59cac30cafa4b05565
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
This commit is contained in:
Allan Sandfeld Jensen 2013-10-11 15:29:51 +02:00 committed by The Qt Project
parent eea1c359c9
commit 5e4b9f1154

View File

@ -1883,11 +1883,12 @@ QFontEngine *QTextEngine::fontEngine(const QScriptItem &si, QFixed *ascent, QFix
scaledEngine = feCache.prevScaledFontEngine;
} else {
QFontEngine *scEngine = rawFont.d->fontEngine->cloneWithSize(smallCapsFraction * rawFont.pixelSize());
scEngine->ref.ref();
scaledEngine = QFontEngineMultiQPA::createMultiFontEngine(scEngine, script);
scaledEngine->ref.ref();
feCache.prevScaledFontEngine = scaledEngine;
// If scEngine is not ref'ed by scaledEngine, make sure it is deallocated and not leaked.
if (!scEngine->ref.load())
if (!scEngine->ref.deref())
delete scEngine;
}