Use QBasicAtomicInt load() and store() instead of implicit casting
authorBradley T. Hughes <bradley.hughes@nokia.com>
Mon, 3 Oct 2011 08:50:45 +0000 (10:50 +0200)
committerQt by Nokia <qt-info@nokia.com>
Mon, 10 Oct 2011 08:23:17 +0000 (10:23 +0200)
The implicit casts will be unavailable in the near future

Change-Id: Ieab3603e500d3621e65f96d970c9935be7f3aa52
Reviewed-on: http://codereview.qt-project.org/6229
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
src/declarative/qml/v8/qjsvalue_impl_p.h

index b0ad766..b7ff6a8 100644 (file)
@@ -51,15 +51,15 @@ public:
     QGlobalStaticDeleter(QGlobalStatic<QJSValuePrivate> &_globalStatic)
         : globalStatic(_globalStatic)
     {
-        globalStatic.pointer->ref.ref();
+        globalStatic.pointer.load()->ref.ref();
     }
 
     inline ~QGlobalStaticDeleter()
     {
-        if (!globalStatic.pointer->ref.deref()) { // Logic copy & paste from SharedDataPointer
-            delete globalStatic.pointer;
+        if (!globalStatic.pointer.load()->ref.deref()) { // Logic copy & paste from SharedDataPointer
+            delete globalStatic.pointer.load();
         }
-        globalStatic.pointer = 0;
+        globalStatic.pointer.store(0);
         globalStatic.destroyed = true;
     }
 };