- wxASSERT( p != NULL ); // can't free memory?
- wxASSERT( p == pData ); // we're decrementing the size - block shouldn't move!
+ if ( p != pData )
+ {
+ // contrary to what one might believe, some realloc() implementation do
+ // move the memory block even when its size is reduced
+ pData = (wxStringData *)p;
+
+ m_pchData = pData->data();
+ }
+
+ pData->nAllocLength = nLen;