From 79e929e79ebbd2e1c4ff7f35d619c0b8b30f0135 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 10 Mar 2003 18:11:15 +0000 Subject: [PATCH] fixed a serious bug in Shrink() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19535 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/dynarray.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/common/dynarray.cpp b/src/common/dynarray.cpp index 72284fcb73..c6890ce3a0 100644 --- a/src/common/dynarray.cpp +++ b/src/common/dynarray.cpp @@ -221,7 +221,11 @@ void name::Shrink() \ memcpy(pNew, m_pItems, m_nCount*sizeof(T)); \ delete [] m_pItems; \ m_pItems = pNew; \ + \ + /* update the size of the new block */ \ + m_nSize = m_nCount; \ } \ + /* else: don't do anything, better keep old memory block! */ \ } \ } \ \ -- 2.50.0