diff options
Diffstat (limited to 'src/qml/jsapi/qjsvalue.cpp')
-rw-r--r-- | src/qml/jsapi/qjsvalue.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/qml/jsapi/qjsvalue.cpp b/src/qml/jsapi/qjsvalue.cpp index 9031187d7e..4035fb9fa6 100644 --- a/src/qml/jsapi/qjsvalue.cpp +++ b/src/qml/jsapi/qjsvalue.cpp @@ -712,11 +712,12 @@ void QJSValue::setPrototype(const QJSValue& prototype) */ QJSValue& QJSValue::operator=(const QJSValue& other) { - if (d == other.d) - return *this; - d->deref(); - d = other.d; - d->ref(); + if (d != other.d) { + d->deref(); + d = other.d; + d->ref(); + } + return *this; } /*! |