From 1bb5cb5ca6c7867f99caf83ed4a1ca146e41a31b Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sat, 12 Sep 2020 21:42:00 +0300 Subject: [PATCH] call QListData::freeData() instead of plain free() in QList methods Signed-off-by: Ivailo Monev --- src/core/tools/qlist.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/core/tools/qlist.h b/src/core/tools/qlist.h index 4db7a8e45..570d8d0f0 100644 --- a/src/core/tools/qlist.h +++ b/src/core/tools/qlist.h @@ -383,7 +383,7 @@ Q_INLINE_TEMPLATE QList &QList::operator=(const QList &l) if (!d->ref.deref()) { node_destruct(reinterpret_cast(d->array + d->begin), reinterpret_cast(d->array + d->end)); - free(d); + QListData::freeData(d); } d = o; } @@ -620,7 +620,7 @@ Q_OUTOFLINE_TEMPLATE typename QList::Node *QList::detach_helper_grow(int i node_copy(reinterpret_cast(p.begin()), reinterpret_cast(p.begin() + i), n); } QT_CATCH(...) { - free(d); + QListData::freeData(d); d = x; QT_RETHROW; } @@ -630,13 +630,13 @@ Q_OUTOFLINE_TEMPLATE typename QList::Node *QList::detach_helper_grow(int i } QT_CATCH(...) { node_destruct(reinterpret_cast(p.begin()), reinterpret_cast(p.begin() + i)); - free(d); + QListData::freeData(d); d = x; QT_RETHROW; } if (!x->ref.deref()) - free(x); + QListData::freeData(x); return reinterpret_cast(p.begin() + i); } @@ -649,13 +649,13 @@ Q_OUTOFLINE_TEMPLATE void QList::detach_helper(int alloc) QT_TRY { node_copy(reinterpret_cast(p.begin()), reinterpret_cast(p.end()), n); } QT_CATCH(...) { - free(d); + QListData::freeData(d); d = x; QT_RETHROW; } if (!x->ref.deref()) - free(x); + QListData::freeData(x); } template -- 2.11.0