From 703e28728346edfccd610a926efb9a584b8f133b Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 8 Aug 2012 15:02:30 +0200 Subject: 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 --- src/corelib/tools/qmap.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/corelib/tools/qmap.h') 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(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 *>(const_cast(&QMapDataBase::shared_null))) { } QMap(const QMap &other); - inline ~QMap() { if (!d->ref.deref()) d->free(); } + inline ~QMap() { if (!d->ref.deref()) d->destroy(); } QMap &operator=(const QMap &other); #ifdef Q_COMPILER_RVALUE_REFS @@ -782,7 +782,7 @@ Q_OUTOFLINE_TEMPLATE void QMap::detach_helper() x->header.left->setParent(&x->header); } if (!d->ref.deref()) - d->free(); + d->destroy(); d = x; } -- cgit v1.2.3