]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/dynarray.cpp
Add various selection menu items to the sample.
[wxWidgets.git] / src / common / dynarray.cpp
index 86a106d5568bae45cd544d0cb470ffdc5c1cd71c..8d62ca6b06101e411e656886e72367ee9759fb16 100644 (file)
@@ -358,6 +358,9 @@ void name::insert(iterator it, const_iterator first, const_iterator last)   \
       return;                                                               \
   Grow(nInsert);                                                            \
                                                                             \
+  /* old iterator could have been invalidated by Grow(). */                 \
+  it = begin() + nIndex;                                                    \
+                                                                            \
   memmove(&m_pItems[nIndex + nInsert], &m_pItems[nIndex],                   \
           (m_nCount - nIndex)*sizeof(T));                                   \
   for (size_t i = 0; i < nInsert; ++i, ++it, ++first)                       \