summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/script/api/qscriptstring.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/script/api/qscriptstring.cpp b/src/script/api/qscriptstring.cpp
index 0107c52..1623d92 100644
--- a/src/script/api/qscriptstring.cpp
+++ b/src/script/api/qscriptstring.cpp
@@ -87,9 +87,9 @@ QScriptString::QScriptString(const QScriptString &other)
: d_ptr(other.d_ptr)
{
if (d_func() && (d_func()->type == QScriptStringPrivate::StackAllocated)) {
- Q_ASSERT(d_func()->ref.load() != 1);
+ Q_ASSERT(d_func()->ref.loadRelaxed() != 1);
d_ptr.detach();
- d_func()->ref.store(1);
+ d_func()->ref.storeRelaxed(1);
d_func()->type = QScriptStringPrivate::HeapAllocated;
d_func()->engine->registerScriptString(d_func());
}
@@ -104,11 +104,11 @@ QScriptString::~QScriptString()
if (d) {
switch (d->type) {
case QScriptStringPrivate::StackAllocated:
- Q_ASSERT(d->ref.load() == 1);
+ Q_ASSERT(d->ref.loadRelaxed() == 1);
d->ref.ref(); // avoid deletion
break;
case QScriptStringPrivate::HeapAllocated:
- if (d->engine && (d->ref.load() == 1)) {
+ if (d->engine && (d->ref.loadRelaxed() == 1)) {
// Make sure the identifier is removed from the correct engine.
QScript::APIShim shim(d->engine);
d->identifier = JSC::Identifier();
@@ -124,15 +124,15 @@ QScriptString::~QScriptString()
*/
QScriptString &QScriptString::operator=(const QScriptString &other)
{
- if (d_func() && d_func()->engine && (d_func()->ref.load() == 1) && (d_func()->type == QScriptStringPrivate::HeapAllocated)) {
+ if (d_func() && d_func()->engine && (d_func()->ref.loadRelaxed() == 1) && (d_func()->type == QScriptStringPrivate::HeapAllocated)) {
// current d_ptr will be deleted at the assignment below, so unregister it first
d_func()->engine->unregisterScriptString(d_func());
}
d_ptr = other.d_ptr;
if (d_func() && (d_func()->type == QScriptStringPrivate::StackAllocated)) {
- Q_ASSERT(d_func()->ref.load() != 1);
+ Q_ASSERT(d_func()->ref.loadRelaxed() != 1);
d_ptr.detach();
- d_func()->ref.store(1);
+ d_func()->ref.storeRelaxed(1);
d_func()->type = QScriptStringPrivate::HeapAllocated;
d_func()->engine->registerScriptString(d_func());
}