From: Ivailo Monev Date: Sat, 12 Sep 2020 18:42:00 +0000 (+0300) Subject: call QListData::freeData() instead of plain free() in QList methods X-Git-Tag: 4.12.0~3527 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=1bb5cb5ca6c7867f99caf83ed4a1ca146e41a31b;p=kde%2FKatie.git call QListData::freeData() instead of plain free() in QList methods Signed-off-by: Ivailo Monev --- 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