diff options
Diffstat (limited to 'src/corelib/tools/qlist.h')
-rw-r--r-- | src/corelib/tools/qlist.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h index a15b0c9124..9d70e55b1e 100644 --- a/src/corelib/tools/qlist.h +++ b/src/corelib/tools/qlist.h @@ -55,6 +55,7 @@ #include <initializer_list> #endif +#include <stdlib.h> #include <new> #include <limits.h> #include <string.h> @@ -667,7 +668,7 @@ Q_OUTOFLINE_TEMPLATE typename QList<T>::Node *QList<T>::detach_helper_grow(int i node_copy(reinterpret_cast<Node *>(p.begin()), reinterpret_cast<Node *>(p.begin() + i), n); } QT_CATCH(...) { - qFree(d); + free(d); d = x; QT_RETHROW; } @@ -677,7 +678,7 @@ Q_OUTOFLINE_TEMPLATE typename QList<T>::Node *QList<T>::detach_helper_grow(int i } QT_CATCH(...) { node_destruct(reinterpret_cast<Node *>(p.begin()), reinterpret_cast<Node *>(p.begin() + i)); - qFree(d); + free(d); d = x; QT_RETHROW; } @@ -696,7 +697,7 @@ Q_OUTOFLINE_TEMPLATE void QList<T>::detach_helper(int alloc) QT_TRY { node_copy(reinterpret_cast<Node *>(p.begin()), reinterpret_cast<Node *>(p.end()), n); } QT_CATCH(...) { - qFree(d); + free(d); d = x; QT_RETHROW; } @@ -721,7 +722,7 @@ Q_OUTOFLINE_TEMPLATE QList<T>::QList(const QList<T> &l) struct Cleanup { Cleanup(QListData::Data *d) : d_(d) {} - ~Cleanup() { if (d_) qFree(d_); } + ~Cleanup() { if (d_) free(d_); } QListData::Data *d_; } tryCatch(d); @@ -763,7 +764,7 @@ Q_OUTOFLINE_TEMPLATE void QList<T>::dealloc(QListData::Data *data) { node_destruct(reinterpret_cast<Node *>(data->array + data->begin), reinterpret_cast<Node *>(data->array + data->end)); - qFree(data); + free(data); } |