summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qmap.h
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2012-08-08 15:02:30 +0200
committerQt by Nokia <qt-info@nokia.com>2012-08-09 03:26:10 +0200
commit703e28728346edfccd610a926efb9a584b8f133b (patch)
tree42d2b608cb2c488d4a66f7d88f3ddea5d4b21d23 /src/corelib/tools/qmap.h
parent9e96717746850205eba7d4957ddb4d0322875fff (diff)
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>
Diffstat (limited to 'src/corelib/tools/qmap.h')
-rw-r--r--src/corelib/tools/qmap.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h
index 9cab1035d1..af3df216ff 100644
--- a/src/corelib/tools/qmap.h
+++ b/src/corelib/tools/qmap.h
@@ -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;
}