summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qvarlengtharray.h
diff options
context:
space:
mode:
authorGareth Stockwell <gareth.stockwell@sosco.com>2009-08-19 11:57:27 (GMT)
committerGareth Stockwell <gareth.stockwell@sosco.com>2009-08-19 11:57:27 (GMT)
commitd9e03376f9f82e5664dfd2446ff4c05e35ffb535 (patch)
tree711f77f7d307c05a3ae310b1fd59bbce74bd8eab /src/corelib/tools/qvarlengtharray.h
parent98d4c657803d5f1956560bd9b62e73f15c05e8fd (diff)
parentca0b5b503e8865c0eedeea86aa132291281fc49f (diff)
downloadQt-d9e03376f9f82e5664dfd2446ff4c05e35ffb535.zip
Qt-d9e03376f9f82e5664dfd2446ff4c05e35ffb535.tar.gz
Qt-d9e03376f9f82e5664dfd2446ff4c05e35ffb535.tar.bz2
Merged in DummyPlayer changes
Diffstat (limited to 'src/corelib/tools/qvarlengtharray.h')
-rw-r--r--src/corelib/tools/qvarlengtharray.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h
index 0b9d908..8c31f40 100644
--- a/src/corelib/tools/qvarlengtharray.h
+++ b/src/corelib/tools/qvarlengtharray.h
@@ -34,7 +34,7 @@
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
+** contact the sales department at http://qt.nokia.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -204,7 +204,9 @@ Q_OUTOFLINE_TEMPLATE void QVarLengthArray<T, Prealloc>::realloc(int asize, int a
if (QTypeInfo<T>::isStatic) {
QT_TRY {
- while (s < asize) {
+ // copy all the old elements
+ const int copySize = qMin(asize, osize);
+ while (s < copySize) {
new (ptr+s) T(*(oldPtr+s));
(oldPtr+s)->~T();
s++;