
CStringList Error I Think
I am getting an access violation when I try to clean up a CStringList
in a class destructor. It seems to work some times and not at other
times. I am using RemoveAll. Below is the code that does the
deletion:
if( m_oColumnLabels.GetSize() > 0)
{
m_oColumnLabels.RemoveAll();
}
I have also tried just a RemoveAll without checking the size but I get
the same results. What is also puzzling is that if I put a breakpoint
on the RemoveAll statement and wait before continuing I don't get the
error but this is not consistent either. Below is a call stack:
__sbh_free_block(tagHeader * 0x011d1eb4, void * 0x02215e50) line 337 +
12 bytes
_free_base(void * 0x02215e50) line 52 + 13 bytes
_free_dbg_lk(void * 0x02215e70, int 1) line 1083 + 9 bytes
_free_dbg(void * 0x02215e70, int 1) line 970 + 13 bytes
operator delete(void * 0x02215e70) line 351 + 12 bytes
CString::FreeData() line 146 + 15 bytes
CString::~CString() line 213
PivotColumn::~PivotColumn() line 80 + 45 bytes
Any help would be greatly appreciated.
Thanks in advance!