I have some code that is crashing in a large system. However, the code essentially boils down to the following pseudo-code. I\'ve removed much of the detail, as I have tried
Microsoft provides the source for their C runtime; you can check there to see what _CrtIsValidHeapPointer does. On my installation, it's under C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\crt\src\dbgheap.c.
One other suggestion is to check the disassembly of
delete newObj; // scalar delete
and compare it to the disassembly generated for
delete[] newObj;
and
delete pointerToClassLikeMyClassThatIsInExeAndNotDll;
to test your theory about delete[] being called. Similarly, you could check the call stack for
delete pointerToClassLikeMyClassThatIsInExeAndNotDll;
to test your theory about mydll_d.dll!operator delete() versus myexe_d.exe!operator delete().