Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
// minimizes the memory usage by freeing unused memory
void wxArrayString::Shrink()
{
// only do it if we have some memory to free
if( m_nCount < m_nSize ) {
// allocates exactly as much memory as we need
wxChar **pNew = new wxChar *[m_nCount];
// copy data to new location
memcpy(pNew, m_pItems, m_nCount*sizeof(wxChar *));
delete [] m_pItems;
m_pItems = pNew;
}
}
// minimizes the memory usage by freeing unused memory
void wxArrayString::Shrink()
{
// only do it if we have some memory to free
if( m_nCount < m_nSize ) {
// allocates exactly as much memory as we need
wxChar **pNew = new wxChar *[m_nCount];
// copy data to new location
memcpy(pNew, m_pItems, m_nCount*sizeof(wxChar *));
delete [] m_pItems;
m_pItems = pNew;
m_nSize = m_nCount; // <--- save new real size!
}
}
OS: Windows XP Pro
Compiler: MSVC++ 7.1
wxWidgets: 2.8.10