summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qhash.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools/qhash.h')
-rw-r--r--src/corelib/tools/qhash.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h
index 0777f06..c7e4bc1 100644
--- a/src/corelib/tools/qhash.h
+++ b/src/corelib/tools/qhash.h
@@ -589,10 +589,11 @@ template <class Key, class T>
Q_INLINE_TEMPLATE QHash<Key, T> &QHash<Key, T>::operator=(const QHash<Key, T> &other)
{
if (d != other.d) {
- other.d->ref.ref();
+ QHashData *o = other.d;
+ o->ref.ref();
if (!d->ref.deref())
freeData(d);
- d = other.d;
+ d = o;
if (!d->sharable)
detach_helper();
}