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.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h
index 65a5174abf..ebe6527d89 100644
--- a/src/corelib/tools/qvector.h
+++ b/src/corelib/tools/qvector.h
@@ -424,7 +424,7 @@ template <typename T>
void QVector<T>::resize(int asize)
{
if (asize == d->size)
- return;
+ return detach();
if (asize > int(d->alloc) || !isDetached()) { // there is not enough space
QArrayData::AllocationOptions opt = asize > int(d->alloc) ? QArrayData::Grow : QArrayData::Default;
realloc(qMax(int(d->alloc), asize), opt);