src/corelib/tools/qmap.h
changeset 37 758a864f9613
parent 33 3e2da88830cd
equal deleted inserted replaced
36:ef0373b55136 37:758a864f9613
   424 
   424 
   425 template <class Key, class T>
   425 template <class Key, class T>
   426 Q_INLINE_TEMPLATE QMap<Key, T> &QMap<Key, T>::operator=(const QMap<Key, T> &other)
   426 Q_INLINE_TEMPLATE QMap<Key, T> &QMap<Key, T>::operator=(const QMap<Key, T> &other)
   427 {
   427 {
   428     if (d != other.d) {
   428     if (d != other.d) {
   429         other.d->ref.ref();
   429         QMapData* o = other.d;
       
   430         o->ref.ref();
   430         if (!d->ref.deref())
   431         if (!d->ref.deref())
   431             freeData(d);
   432             freeData(d);
   432         d = other.d;
   433         d = o;
   433         if (!d->sharable)
   434         if (!d->sharable)
   434             detach_helper();
   435             detach_helper();
   435     }
   436     }
   436     return *this;
   437     return *this;
   437 }
   438 }