Details
-
Suggestion
-
Resolution: Invalid
-
P3: Somewhat important
-
4.3.2
-
None
Description
QList<> will call qFatal when it fails to allocate enough money giving the programmer a chance to do some cleanup before the application crashes.
QVector<> does not seem to do this. It would be helpful if it did.
E.g.
void QListData::realloc(int alloc)
{
Q_ASSERT(d->ref == 1);
Data *x = static_cast<Data *>(qRealloc(d, DataHeaderSize + alloc * sizeof(void *)));
if (!x)
qFatal("QList: Out of memory");