I am getting a mismatched allocation/deallocation error.
It's strange becamse it happens on new and delete lines. The
deallocation error is on the line that is commented //DEALLOCATION, and
the corresponding allocation error is on the comment //ALLOCATION. The
code that causes this problem is below. I've attached the inspector
results. Is this a legitimate error?
I suspect that it is
because the program crashes in the Free() function when the destructor
is called. However I'm pretty sure I'm doing the right thing.
m_list is a STL vector. I've also tried using a C++ array with the same results. Platform is VC 2008. I've tried compiling with Intel compiler and also with VC 2005 with the same crashing effect.
Thanks for any help.
bool ICAPHPG::Allocate(int count_in)
m_hpgCount = count_in;
for (unsigned int i = 0; i < m_list.size(); i++)
if (m_list != NULL)
delete m_list; //DEALLOCATE
bool ICAPHPG::loadHPG(int idx, const char* path)
if (idx < 0 || idx >= m_hpgCount)
hpgns::CircularHPG* h = new hpgns::CircularHPG((char*)path); //ALLOCATE
if (h == NULL)
else if (h->GetError())