summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qvector.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools/qvector.h')
-rw-r--r--src/corelib/tools/qvector.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h
index b68ca87063..4dbf95c315 100644
--- a/src/corelib/tools/qvector.h
+++ b/src/corelib/tools/qvector.h
@@ -397,7 +397,11 @@ void QVector<T>::reserve(int asize)
{
if (asize > int(d->alloc))
reallocData(d->size, asize);
- if (isDetached())
+ if (isDetached()
+#if !defined(QT_NO_UNSHARABLE_CONTAINERS)
+ && d != Data::unsharableEmpty()
+#endif
+ )
d->capacityReserved = 1;
Q_ASSERT(capacity() >= asize);
}