Fixed bug in Grow function (possibly not allocating enough memory if starting

with empty array).


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@17128 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Neis
2002-09-11 10:29:28 +00:00
parent b00e9f10c7
commit a1db4ad4a4
2 changed files with 8 additions and 3 deletions

View File

@@ -1762,6 +1762,8 @@ void wxArrayString::Grow(size_t nIncrement)
if ( m_nSize == 0 ) {
// was empty, alloc some memory
m_nSize = ARRAY_DEFAULT_INITIAL_SIZE;
if (m_nSize < nIncrement)
m_nSize = nIncrement;
m_pItems = new wxChar *[m_nSize];
}
else {