diff options
author | Olivier Goffart <olivier.goffart@nokia.com> | 2010-08-23 11:44:12 (GMT) |
---|---|---|
committer | Olivier Goffart <olivier.goffart@nokia.com> | 2010-08-23 15:22:31 (GMT) |
commit | a2f83283a64460ca26530321f8eb64f3ddfe4c8b (patch) | |
tree | c06929f2751f839245bd434b42fbe9fe8de43ee6 /src/corelib/tools/qhash.h | |
parent | d405aa6510514ce02b312994db55c305bde60285 (diff) | |
download | Qt-a2f83283a64460ca26530321f8eb64f3ddfe4c8b.zip Qt-a2f83283a64460ca26530321f8eb64f3ddfe4c8b.tar.gz Qt-a2f83283a64460ca26530321f8eb64f3ddfe4c8b.tar.bz2 |
Fix assignment of a container included in the container itself
Task-number: QTBUG-13079
Reviewed-by: Joao
Diffstat (limited to 'src/corelib/tools/qhash.h')
-rw-r--r-- | src/corelib/tools/qhash.h | 5 |
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(); } |