From: Thiago Macieira Date: Wed, 8 Aug 2012 13:02:30 +0000 (+0200) Subject: Rename QMapData::free to destroy X-Git-Tag: v5.0.0-beta1~349 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=703e28728346edfccd610a926efb9a584b8f133b;p=profile%2Fivi%2Fqtbase.git 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 --- diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h index 9cab103..af3df21 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; }