From 343535d7cbae16c02517664ce0d363e9834bd74d Mon Sep 17 00:00:00 2001 From: Martin Jones Date: Thu, 15 Oct 2009 14:16:42 +1000 Subject: Use Q_GLOBAL_STATIC for global static. --- src/declarative/qml/qmlcompiler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp index c744509..e2fd7cb 100644 --- a/src/declarative/qml/qmlcompiler.cpp +++ b/src/declarative/qml/qmlcompiler.cpp @@ -2039,7 +2039,7 @@ bool QmlCompiler::mergeDynamicMetaProperties(QmlParser::Object *obj) return true; } -static QAtomicInt classIndexCounter; +Q_GLOBAL_STATIC(QAtomicInt, classIndexCounter) bool QmlCompiler::buildDynamicMeta(QmlParser::Object *obj, DynamicMetaMode mode) { @@ -2058,7 +2058,7 @@ bool QmlCompiler::buildDynamicMeta(QmlParser::Object *obj, DynamicMetaMode mode) QByteArray newClassName = obj->metatype->className(); newClassName.append("_QML_"); - int idx = classIndexCounter.fetchAndAddRelaxed(1); + int idx = classIndexCounter()->fetchAndAddRelaxed(1); newClassName.append(QByteArray::number(idx)); QMetaObjectBuilder builder; -- cgit v0.12