I have the following line of code:
if (MyData)
{
delete MyData;
MyData= NULL;
}
Below is MyData:
SomeDataStructure *MyData;
Every time this code segment is called I get a fatal error that causes my
program to terminate.
I use the debugger and upon reaching this line of code MyData is still valid
and still has the correct information in it.
I have searched the internet and pretty much figured that it was some sort
of memory allocation problem... either I'm deleting what's not there, or
even I've read deleting from different stacks? Any ideas as to why this
delete cause and error?