Fix inserting an element of wxArrayString itself back into it.
Do the insertion/addition before deallocating the old memory to allow things like array.Add(array[0]) to work correctly. Closes #2290. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@76907 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -364,7 +364,10 @@ protected:
|
||||
void Copy(const wxArrayString& src); // copies the contents of another array
|
||||
|
||||
private:
|
||||
void Grow(size_t nIncrement = 0); // makes array bigger if needed
|
||||
// Allocate the new buffer big enough to hold m_nCount + nIncrement items and
|
||||
// return the pointer to the old buffer, which must be deleted by the caller
|
||||
// (if the old buffer is big enough, just return NULL).
|
||||
wxString *Grow(size_t nIncrement);
|
||||
|
||||
size_t m_nSize, // current size of the array
|
||||
m_nCount; // current number of elements
|
||||
|
Reference in New Issue
Block a user