Rename QMapData::free to destroy
The convention for QMap is that "free" methods simply free memory and that "destroy" ones also run destructors of types affected. Since this function calls destroySubTree, it should be more properly called "destroy". This also gets rid of another function called simply "free" in our headers. Change-Id: I3fa621c78848ede33dd5b78428c704d0423ba4e7 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>bb10
parent
9e96717746
commit
703e287283
|
|
@ -231,7 +231,7 @@ struct QMapData : public QMapDataBase
|
|||
return static_cast<QMapData *>(createData());
|
||||
}
|
||||
|
||||
void free() {
|
||||
void destroy() {
|
||||
if (root()) {
|
||||
root()->destroySubTree();
|
||||
freeTree(header.left, Q_ALIGNOF(Node));
|
||||
|
|
@ -331,7 +331,7 @@ public:
|
|||
inline QMap() : d(static_cast<QMapData<Key, T> *>(const_cast<QMapDataBase *>(&QMapDataBase::shared_null))) { }
|
||||
QMap(const QMap<Key, T> &other);
|
||||
|
||||
inline ~QMap() { if (!d->ref.deref()) d->free(); }
|
||||
inline ~QMap() { if (!d->ref.deref()) d->destroy(); }
|
||||
|
||||
QMap<Key, T> &operator=(const QMap<Key, T> &other);
|
||||
#ifdef Q_COMPILER_RVALUE_REFS
|
||||
|
|
@ -782,7 +782,7 @@ Q_OUTOFLINE_TEMPLATE void QMap<Key, T>::detach_helper()
|
|||
x->header.left->setParent(&x->header);
|
||||
}
|
||||
if (!d->ref.deref())
|
||||
d->free();
|
||||
d->destroy();
|
||||
d = x;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue