wxArrayString::Alloc() shouldn't clear the array contents
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43203 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -69,12 +69,19 @@ Deprecated methods since 2.6.x and their replacements
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
Major new features in 2.7 release
|
Major new features in 2.8 release
|
||||||
---------------------------------
|
---------------------------------
|
||||||
|
|
||||||
- New AUI library supporting docking windows and much more.
|
- New AUI library supporting docking windows and much more.
|
||||||
|
|
||||||
|
|
||||||
|
2.8.0
|
||||||
|
-----
|
||||||
|
|
||||||
|
All:
|
||||||
|
|
||||||
|
- wxArrayString::Alloc() now works as reserve() and doesn't clear array contents
|
||||||
|
|
||||||
2.7.2
|
2.7.2
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
@@ -2191,13 +2191,16 @@ void wxArrayString::Alloc(size_t nSize)
|
|||||||
{
|
{
|
||||||
// only if old buffer was not big enough
|
// only if old buffer was not big enough
|
||||||
if ( nSize > m_nSize ) {
|
if ( nSize > m_nSize ) {
|
||||||
Free();
|
wxChar **pNew = new wxChar *[nSize];
|
||||||
wxDELETEA(m_pItems);
|
if ( !pNew )
|
||||||
m_pItems = new wxChar *[nSize];
|
return;
|
||||||
|
|
||||||
|
memcpy(pNew, m_pItems, m_nCount*sizeof(wxChar *));
|
||||||
|
delete [] m_pItems;
|
||||||
|
|
||||||
|
m_pItems = pNew;
|
||||||
m_nSize = nSize;
|
m_nSize = nSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_nCount = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// minimizes the memory usage by freeing unused memory
|
// minimizes the memory usage by freeing unused memory
|
||||||
|
Reference in New Issue
Block a user